/* Collections are a separate TV screen; the v7 native focus manager sees only its visible controls. */
body.collection-open #dayMode,body.collection-open #nightMode,body.collection-open #petDock,body.collection-open #soundTip{visibility:hidden!important}
.collection-entry{position:absolute;bottom:0;width:160px;height:44px;pointer-events:auto;border:1px solid #c2ded6;border-radius:14px;background:#123c37;color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer;z-index:4}
.collection-entry[data-user="dabao"]{left:266px}.collection-entry[data-user="xiaobao"]{right:266px;background:#804111;border-color:#f6cf87}
.collection-entry b,.collection-entry small{display:block}.collection-entry small{font-size:11px;margin-top:3px;font-weight:400;opacity:.8}
.collection-screen{display:none;position:fixed;top:0;right:0;bottom:0;left:0;inset:0;width:100%;height:100%;box-sizing:border-box;z-index:130;background:#0b181a;color:#eaf5f1;padding:3vh 4vw;padding:clamp(18px,3vh,38px) clamp(24px,4vw,70px);box-sizing:border-box;font-family:inherit}
.collection-screen.show{display:flex;flex-direction:column;grid-gap:16px;gap:16px}.collection-screen[data-user="xiaobao"]{background:radial-gradient(ellipse at 80% 35%,#573812,#241b19 65%);--collection-accent:#ffd275}
.collection-screen[data-user="dabao"]{--collection-accent:#7de1c5;background:radial-gradient(ellipse at 85% 25%,#183b38,#0b181a 70%)}
.collection-top{display:flex;align-items:center;justify-content:space-between;grid-gap:18px;gap:18px;flex:none}.collection-top h2{font-size:3vw;font-size:clamp(23px,3vw,38px);margin:0}.collection-kicker{font-size:12px;letter-spacing:3px;color:var(--collection-accent);margin:0 0 5px}.collection-count{font-size:14px;color:#acbfba;margin-left:14px}
.collection-screen button{font-family:inherit;cursor:pointer;color:inherit}.collection-close,.collection-button{border:1px solid #55736b;border-radius:12px;background:#203d36;padding:12px 20px;font-size:17px;min-height:46px}.collection-button.primary{background:var(--collection-accent);color:#142621;border-color:transparent;font-weight:800}.collection-screen button:disabled{opacity:.4;cursor:default}
.collection-screen button:focus-visible,.collection-entry:focus-visible{outline:4px solid #ffd24d;outline-offset:3px}.collection-workspace{display:grid;grid-template-columns:minmax(260px,1fr) minmax(440px,1.5fr);grid-gap:26px;gap:26px;min-height:0;flex:1}
.collection-library{min-height:0;display:flex;flex-direction:column;grid-gap:12px;gap:12px}.collection-target{border:1px solid #3b6055;border-radius:14px;background:#ffffff08;padding:12px 15px;font-size:15px;line-height:1.6}.collection-target strong{color:var(--collection-accent)}
.collection-grid{display:grid;grid-auto-rows:max-content;align-items:start;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;grid-gap:14px;gap:14px;overflow:auto;min-height:0;padding:6px 8px 14px 5px}.collection-card{position:relative;border:1px solid #466155;border-radius:12px;padding:0;overflow:hidden;text-align:left;background:#20382f;min-width:0}.collection-card.selected{border:3px solid var(--collection-accent)}
.collection-card img,.collection-card .collection-placeholder{width:100%;aspect-ratio:9/16;object-fit:contain;display:block;background:#091611}.collection-placeholder{display:grid!important;place-items:center;font-size:34px;color:#7caa99}.collection-card-label{padding:8px;display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collection-card-state{position:absolute;top:6px;left:6px;border-radius:6px;padding:3px 6px;background:#071e1bdd;color:#dceee6;font-size:11px}
.collection-detail{display:grid;grid-template-columns:minmax(160px,.85fr) minmax(205px,1fr);grid-gap:22px;gap:22px;min-height:0;align-items:center}.collection-stage{align-self:stretch;min-height:0;position:relative;display:flex;justify-content:center;align-items:center;background:#0003;border-radius:18px;overflow:hidden}.collection-stage img,.collection-stage video{height:100%;width:100%;object-fit:contain;min-height:0}.collection-stage video{position:absolute;top:0;right:0;bottom:0;left:0;inset:0}.collection-detail-copy{overflow:auto;max-height:100%;padding:5px}.collection-detail-copy h3{font-size:27px;margin:10px 0}.collection-description{font-size:16px;line-height:1.7;color:#c0d2cb;white-space:pre-line}.collection-actions{display:flex;flex-direction:column;grid-gap:10px;gap:10px;margin-top:20px}.collection-note{color:#a6bdb3;font-size:13px;line-height:1.6}.collection-status{min-height:22px;color:var(--collection-accent);font-size:15px;flex:none}.collection-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px dashed #4c7063;border-radius:18px;min-height:180px;text-align:center;padding:20px;color:#acc8bd}.collection-empty b{font-size:21px;color:#e4eee9;margin-bottom:10px}
.collection-home{position:absolute;bottom:46px;height:172px;width:120px;pointer-events:none;z-index:3;display:none}.collection-home[data-user="dabao"]{left:55px}.collection-home[data-user="xiaobao"]{right:55px}.collection-home img,.collection-home video,.collection-home canvas{width:100%;height:100%;object-fit:contain;display:block}.collection-home video,.collection-home canvas{position:absolute;top:0;right:0;bottom:0;left:0;inset:0}.collection-home[data-mode="portrait"] img,.collection-home[data-mode="portrait"] video{border-radius:12px}.collection-home[data-mode="sprite"]{width:220px}.collection-home[data-mode="sprite"][data-user="dabao"]{left:8px}.collection-home[data-mode="sprite"][data-user="xiaobao"]{right:8px}
.collection-parent{border:1px solid #d9e4df;border-radius:20px;padding:20px;margin:18px 0;background:#fff;color:#263c35}.collection-parent h3{margin:0 0 6px}.collection-parent p{font-size:13px;line-height:1.6;color:#63766e}.collection-parent-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));grid-gap:14px;gap:14px}.collection-parent-card{border:1px solid #e0e8e3;border-radius:13px;padding:12px}.collection-parent-card img{float:left;width:62px;height:110px;object-fit:contain;margin:0 12px 10px 0;border-radius:8px;background:#edf3ef}.collection-parent-card label{display:block;margin:8px 0;font-size:13px}.collection-parent-card input[type=number]{width:80px;padding:7px}.collection-parent-card button{padding:9px 12px;margin:5px 6px 0 0;border-radius:8px;border:1px solid #c3d4cb;background:#e8f3ed;color:#274c39}.collection-parent-card video{clear:both;display:block;width:100%;max-height:300px;object-fit:contain}.collection-parent-status{font-size:13px;color:#416651;min-height:20px}
@media(max-width:1000px){.collection-entry{width:130px}.collection-entry[data-user="dabao"]{left:225px}.collection-entry[data-user="xiaobao"]{right:225px}.pet-pod{width:210px}.collection-workspace{grid-template-columns:minmax(220px,.9fr) minmax(370px,1.5fr);grid-gap:16px;gap:16px}.collection-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-detail{grid-gap:14px;gap:14px;grid-template-columns:minmax(135px,.8fr) minmax(190px,1fr)}}
@media(max-height:620px){.collection-screen{padding:18px 30px;grid-gap:10px;gap:10px}.collection-top h2{font-size:25px}.collection-detail-copy h3{font-size:23px}.collection-button,.collection-close{padding:9px 12px;min-height:40px;font-size:15px}.collection-actions{margin-top:12px;grid-gap:7px;gap:7px}.collection-description{font-size:14px}.collection-target{padding:8px 12px}.collection-note{font-size:12px}}
@media(max-width:700px){.collection-workspace{grid-template-columns:1fr;overflow:auto}.collection-grid{grid-template-columns:repeat(4,minmax(80px,1fr));max-height:200px}.collection-detail{min-height:310px;grid-template-columns:1fr 1fr}.collection-entry{width:110px;bottom:45px}.collection-entry[data-user="dabao"]{left:8px}.collection-entry[data-user="xiaobao"]{right:8px}}
.collection-home [hidden],.collection-stage [hidden]{display:none!important}

.collection-top>div:last-child{display:flex;align-items:center;grid-gap:24px;gap:24px}.collection-count{margin-left:0}

/* Keep the complete collection screen and media inside the viewport on the
   same old TV engine; the panel must not size itself from its card contents. */
.collection-screen,.collection-screen *{box-sizing:border-box}
.collection-screen{overflow:hidden}.collection-workspace,.collection-detail{min-width:0;grid-template-rows:minmax(0,1fr)}
.collection-screen.show,.collection-top,.collection-top>div:last-child,.collection-library,.collection-actions{gap:0}
.collection-screen>.collection-workspace{margin-top:16px;margin-bottom:16px}
.collection-top>div+div{margin-left:18px}.collection-top>div:last-child>*+*{margin-left:24px}
.collection-library>.collection-grid{margin-top:12px}.collection-actions>*+*{margin-top:10px}
.collection-card img,.collection-card .collection-placeholder{height:26vh;min-height:110px;max-height:300px}
@supports(aspect-ratio:9/16){.collection-card img,.collection-card .collection-placeholder{height:auto;min-height:0;max-height:none}}
@media(max-height:620px){.collection-screen>.collection-workspace{margin-top:10px;margin-bottom:10px}.collection-actions>*+*{margin-top:7px}}
