/* Gate B: approved r03 atoms and typography; real game DOM only. */
html[data-ui-target=competition] body{background:#fff8e8;color:#62462e;font:400 15px/1.5 "PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif}
html[data-ui-target=competition] .game-shell{max-width:660px;padding:8px 10px 12px;padding-bottom:var(--safe-area-inset-bottom,env(safe-area-inset-bottom,12px))}
html[data-ui-target=competition] #home-view{position:relative;isolation:isolate}
.opening-art-scene{display:none}
html[data-ui-target=competition] .opening-art-scene{display:block;position:absolute;top:0;left:0;right:0;height:0;padding-bottom:130.666667%;z-index:-1;pointer-events:none;background:url('../assets/skin/scene_opening_decor_vase_sprout_layout.png') top/100% auto no-repeat,url('../assets/skin/scene_opening_decor_cabinet_wood_layout.png') top/100% auto no-repeat,url('../assets/skin/scene_opening_decor_rug_cream_layout.png') top/100% auto no-repeat,url('../assets/skin/scene_opening_room_bg.png') top/100% auto no-repeat}
html[data-ui-target=competition] #home-view .opening-card{padding:0;background:none!important;border:0!important;box-shadow:none!important}
html[data-ui-target=competition] #home-view .game-header{display:flex;flex-wrap:wrap;align-items:center;padding:0;margin:0 0 6px;gap:6px}
html[data-ui-target=competition] #home-view .brand-logo{width:94px;height:auto;max-width:94px;object-fit:contain}
html[data-ui-target=competition] #home-view .header-actions{display:flex;flex:1;flex-wrap:wrap;gap:4px}
html[data-ui-target=competition] #home-view .header-actions button{border:0;border-radius:0;box-shadow:none;background-color:transparent;min-height:44px;color:#62462e;padding:4px;font-size:12px;font-weight:400;line-height:1.5}
#home-view .catbox-entry-arrow{display:none}
/* Round plate and solid glyph layered independently at natural aspect. */
html[data-ui-target=competition] #home-view #settings-button,#catbox-detail-dialog .dialog-close,.cat-card-favorite{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;font-size:0!important;background-color:transparent!important;background-image:url('../assets/skin/glyph_close.png'),url('../assets/skin/ui_icon_button_round_base.png')!important;background-position:center!important;background-size:54% auto,contain!important;background-repeat:no-repeat!important;flex:none;transform:none}
html[data-ui-target=competition] #home-view #settings-button{background-image:url('../assets/skin/glyph_gear.png'),url('../assets/skin/ui_icon_button_round_base.png')!important}
.cat-card-favorite{background-image:url('../assets/skin/glyph_heart.png'),url('../assets/skin/ui_icon_button_round_base.png')!important;top:4px!important;right:4px!important}
.cat-card-favorite[data-favorite=true]::after{content:"";position:absolute;left:8px;right:8px;bottom:4px;height:3px;background:#b76f61}
/* 678:96 resident plate; no template stretch. */
html[data-ui-target=competition] #home-resident{display:block;position:relative;width:100%;max-width:390px;height:0;min-height:0;padding:0 0 14.159292%;margin:6px auto 12px;border:0;border-radius:0;box-shadow:none;background:transparent url('../assets/skin/ui_resident_bar_base.png') center/contain no-repeat;transform:none}
#home-resident::before{display:none}
#home-resident .resident-home-icon{position:absolute;left:14%;top:50%;width:20px;height:auto;transform:translateY(-50%)}
#home-resident .resident-thumb{position:absolute;left:5%;top:22%;width:8%;height:56%;object-fit:contain}
#home-resident span{position:absolute;left:22%;right:18%;top:15%;bottom:16%;display:flex;align-items:center;font-size:13px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
#home-resident b{display:none}
html[data-ui-target=competition] #home-view .intro-copy h1{font-size:19px;font-weight:600;line-height:1.5;margin:0}
html[data-ui-target=competition] #home-view .opening-status{margin:4px 0;min-height:22px}
/* Fixed 64px height. Only clean center extends; caps are 80/70 at 2/3. */
html[data-ui-target=competition] #home-view #open-box,#catbox-detail-dialog #companion-resident,#companion-name-save{position:relative;display:flex;align-items:center;justify-content:center;width:100%;max-width:340px;height:64px;min-height:64px;margin:4px auto;padding:0 35px!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:#62462e!important;font-size:15px!important;font-weight:600!important;line-height:1.5!important;background-color:transparent!important;background-image:url('../assets/skin/main_left.png'),url('../assets/skin/main_right.png'),url('../assets/skin/main_center.png')!important;background-position:left center,right center,53.333333px center!important;background-size:53.333333px 64px,46.666667px 64px,calc(100% - 100px) 64px!important;background-repeat:no-repeat!important;filter:none!important}
#open-box:active,#companion-resident:active,#companion-name-save:active{transform:translateY(2px)}
#open-box:disabled,#companion-resident:disabled,#companion-name-save:disabled{opacity:1!important;color:#8a755c!important;cursor:default}
#open-box:disabled::after,#companion-resident:disabled::after,#companion-name-save:disabled::after{content:"";position:absolute;top:7px;bottom:7px;left:10px;right:10px;background:#fff6df;opacity:.28;pointer-events:none}
#open-box img{width:24px;height:auto;object-fit:contain;margin-right:6px}
/* Approved pure frame, not either composite template. */
html[data-ui-target=competition] #home-view #result-card,#catbox-detail-dialog,.paper-action-dialog,.cat-card,.catbox-header,.companion-bar{border:solid transparent!important;border-width:22px 28px 34px 22px!important;border-image:url('../assets/skin/ui_result_frame_common.png') 55 70 85 55 fill / 22px 28px 34px 22px / 0 stretch round!important;border-radius:0!important;background:none!important;box-shadow:none!important;min-width:0}
html[data-ui-target=competition] #home-view #result-card{padding:0!important;margin:16px 0 8px!important;min-height:0!important;overflow:visible}
html[data-ui-target=competition] #home-view #result-card[hidden]{display:none!important}
#home-view #result-card::before,#home-view #result-card::after{display:none!important}
html[data-ui-target=competition] #home-view #result-card[data-rarity=rare],#catbox-detail-dialog[data-rarity=rare],.cat-card[data-rarity=rare]{border-image-source:url('../assets/skin/ui_result_frame_rare.png')!important}
html[data-ui-target=competition] #home-view #result-card[data-rarity=special],#catbox-detail-dialog[data-rarity=special],.cat-card[data-rarity=special]{border-image-source:url('../assets/skin/ui_result_frame_special.png')!important}
html[data-ui-target=competition] #home-view #result-card[data-rarity=collection],#catbox-detail-dialog[data-rarity=collection],.cat-card[data-rarity=collection]{border-image-source:url('../assets/skin/ui_result_frame_collection.png')!important}
html[data-ui-target=competition] #home-view .result-heading{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:0}
#home-view .rarity-heading{display:flex;flex-direction:row;align-items:center;gap:3px}
#home-view .rarity-emblem{width:27px;height:auto;max-height:none;object-fit:contain}
html[data-ui-target=competition] #home-view .arrival-copy{flex:1;min-width:140px}
html[data-ui-target=competition] #home-view .result-heading h2{display:block;font-size:11px;font-weight:400;line-height:1.5}
html[data-ui-target=competition] #home-view #cat-title,#catbox-detail-dialog h2{font-size:19px;font-weight:600;line-height:1.5;margin:6px 0;overflow-wrap:anywhere}
/* Real 96x45 tags. */
#home-view .rarity-badge,.cat-card-rarity,#catbox-detail-rarity,.cat-card-resident:not([hidden]){display:flex;align-items:center;justify-content:center;position:static;width:96px;height:45px;min-width:96px;min-height:45px;margin:0;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;transform:none!important;background:transparent url('../assets/skin/ui_tag_chip_common.png') center/contain no-repeat!important;font-size:14px!important;font-weight:600!important;line-height:1.5!important;letter-spacing:.04em;white-space:nowrap;color:#62462e}
#result-card[data-rarity=rare] .rarity-badge,.cat-card[data-rarity=rare] .cat-card-rarity,#catbox-detail-rarity[data-rarity=rare],.cat-card-resident:not([hidden]){background-image:url('../assets/skin/ui_tag_chip_rare.png')!important}
#result-card[data-rarity=special] .rarity-badge,.cat-card[data-rarity=special] .cat-card-rarity,#catbox-detail-rarity[data-rarity=special]{background-image:url('../assets/skin/ui_tag_chip_special.png')!important;color:#785b91}
#result-card[data-rarity=collection] .rarity-badge,.cat-card[data-rarity=collection] .cat-card-rarity,#catbox-detail-rarity[data-rarity=collection]{background-image:url('../assets/skin/ui_tag_chip_collection.png')!important;color:#714119}
/* Labels outside silhouettes. Approved fixed fact dimensions and safe zones. */
html[data-ui-target=competition] #home-view .result-facts,#catbox-detail-dialog .detail-list{display:grid;grid-template-columns:repeat(2,150px);justify-content:center;grid-gap:14px 12px;margin:16px 0;padding:0;border:0!important;background:none!important}
html[data-ui-target=competition] #home-view .result-facts>div,#catbox-detail-dialog .detail-list>div{display:block;position:relative;width:150px;max-width:100%;padding:0!important;margin:0;min-height:0;border:0!important;border-radius:0!important;box-shadow:none!important;background:none!important}
html[data-ui-target=competition] #home-view .result-facts dt,#catbox-detail-dialog .detail-list dt{font-size:12px;font-weight:400;line-height:1.4;color:#947359;margin:0 0 5px;padding-left:22px}
html[data-ui-target=competition] #home-view .result-facts dd,#catbox-detail-dialog .detail-list dd{display:flex;align-items:center;flex-wrap:wrap;align-content:center;width:150px;height:72px;box-sizing:border-box;margin:0;padding:18px 28px 17px 22px;background:transparent url('../assets/skin/ui_fact_cell_base.png') center/contain no-repeat;font-size:14px;font-weight:600;line-height:1.3;color:#62462e;overflow-wrap:anywhere;border:0;border-radius:0;gap:0}
html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long,#catbox-detail-dialog .detail-list>.skin-fact-long{grid-column:1/-1;width:300px}
html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long dd,#catbox-detail-dialog .detail-list>.skin-fact-long dd{width:300px;height:112px;padding:18px 28px 17px 22px;background-image:url('../assets/skin/fact_wide_300x112.png')}
html[data-ui-target=competition] #home-view .trait-chip{border:0!important;border-radius:0!important;background:none!important;padding:0 6px 0 0;font-size:14px;font-weight:600;line-height:1.3;box-shadow:none}
html[data-ui-target=competition] #home-view #save-feedback{display:block;text-align:left;white-space:normal;min-height:44px;margin:8px 0;padding:4px 3px;border:0;border-radius:0;background:none;font-size:12px;font-weight:400;line-height:1.5}
html[data-ui-target=competition] #home-view #save-feedback[hidden]{display:none!important}
html[data-ui-target=competition] #home-view .result-actions,#catbox-detail-dialog .dialog-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;background:none;border:0;padding:4px 0}
html[data-ui-target=competition] #home-view .result-actions button,#catbox-detail-dialog .dialog-actions button:not(#companion-resident),#companion-detail-edit,#companion-edit,.paper-action-dialog button:not(#companion-name-save){flex:none;min-height:45px;width:auto;max-width:100%;padding:10px 20px;border:solid transparent!important;border-width:10px 14px!important;border-image:url('../assets/skin/ui_result_frame_common.png') 55 70 85 55 fill / 10px 14px / 0 stretch round!important;border-radius:0!important;box-shadow:none!important;background:none!important;color:#62462e!important;font-size:14px!important;font-weight:500!important;line-height:1.5!important;white-space:normal}
#catbox-detail-dialog #companion-resident{flex-basis:100%}
.catbox-header{padding:0;align-items:center;margin-bottom:6px}.catbox-header h1{font-size:19px;font-weight:600;line-height:1.5}.catbox-header p{font-size:11px}
.companion-bar{padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px}.companion-bar>span{flex:1;min-width:120px;font-size:13px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.cat-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:12px}.cat-card{position:relative;padding:34px 0 0!important;border-width:12px!important;border-image-width:12px!important;overflow:visible!important}.cat-card-open{width:100%;padding:0;border:0;background:none!important;box-shadow:none}.cat-card-visual{background:none!important;border-radius:0!important;overflow:visible}.cat-card-visual img{object-fit:contain}
.cat-card-name{font-size:14px;font-weight:600;line-height:1.3;white-space:normal;overflow-wrap:anywhere;margin:8px 0}.cat-card-rarity{position:absolute;top:0;left:0}.cat-card-meta{display:flex;flex-wrap:wrap;font-size:12px;font-weight:400;line-height:1.5}.cat-card-resident:not([hidden]){margin:4px auto}.cat-card-meta strong{font-weight:600}
/* Existing two cat-ear tabs, no added navigation. */
.catbox-tabs{display:flex;justify-content:center;padding:0;border:0;border-radius:0;background:none;gap:0}
.catbox-tabs button{flex:none;width:160px;height:84px;max-width:50%;padding:20px 33px 16px 38px;border:0;border-radius:0;background:transparent url('../assets/skin/ui_bottom_nav_tab_base.png') center/contain no-repeat!important;box-shadow:none;font-size:13px;font-weight:500;line-height:1.35}
.catbox-tabs button[aria-selected=true]{background-image:url('../assets/skin/tab_selected.png')!important;font-weight:700}
/* Whole detail scroll; preserve complete cat and reachable actions. */
#catbox-detail-dialog{width:calc(100% - 16px);max-width:560px;max-height:calc(100vh - 24px);padding:0;overflow-y:auto}
#catbox-detail-dialog .catbox-detail-scroll{overflow:visible;flex:none;max-height:none;min-height:0}
#catbox-detail-dialog .dialog-heading{display:flex;align-items:flex-start;gap:6px;padding:0}
#catbox-detail-dialog .dialog-heading>div{flex:1;min-width:0}
#catbox-detail-dialog .catbox-detail-visual{padding:0;margin:8px 0;background:none!important;border:0;border-radius:0;gap:6px}
#catbox-detail-dialog #catbox-detail-image{width:210px;height:210px;max-width:100%;max-height:none;object-fit:contain;transform:none}
#catbox-detail-dialog .catbox-detail-heading{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#catbox-detail-dialog .cat-detail-subtitle{font-size:13px;font-weight:400;line-height:1.5}
.paper-action-dialog{width:calc(100% - 24px);max-width:420px;padding:6px;max-height:calc(100vh - 24px);max-height:calc(var(--action-height,100vh) - 24px);overflow-y:auto}
.paper-action-dialog h2{font-size:19px;font-weight:600;line-height:1.5}
.paper-action-dialog input{box-sizing:border-box;width:100%;min-width:0}
button:focus{outline:2px solid #9f663d;outline-offset:3px}
@media(max-width:389px){html[data-ui-target=competition] #home-view .result-facts,#catbox-detail-dialog .detail-list{grid-template-columns:150px;justify-content:start}html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long,#catbox-detail-dialog .detail-list>.skin-fact-long{width:240px;max-width:none}html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long dd,#catbox-detail-dialog .detail-list>.skin-fact-long dd{width:240px;height:89.6px;padding:14.4px 22.4px 13.6px 17.6px}.cat-grid{grid-template-columns:1fr}.catbox-tabs button{width:140px;height:73.5px;padding:17.5px 29px 14px 33.25px}}
@media(min-width:411px){html[data-ui-target=competition] #home-resident{padding-bottom:55.221239px}}
@media(min-width:601px){html[data-ui-target=competition] #home-view .box-stage{height:300px}}
/* Real-page layout corrections; typography unchanged. */
#catbox-detail-dialog[open]{display:block}
html[data-ui-target=competition] #home-view .game-header{background:#fff8e8}
html[data-ui-target=competition] .opening-art-scene{top:90px}
#open-box img{display:none}
html[data-ui-target=competition] #home-view .result-actions button,#catbox-detail-dialog .dialog-actions button:not(#companion-resident),#companion-detail-edit,#companion-edit,.paper-action-dialog button:not(#companion-name-save){width:120px;height:56.25px;min-height:56.25px;padding:0 10px!important;border:0!important;border-image:none!important;background:transparent url('../assets/skin/ui_tag_chip_common.png') center/contain no-repeat!important}
html[data-ui-target=competition] #home-view .result-actions .favorite-action,#catbox-detail-dialog #favorite-catbox-detail{background-image:url('../assets/skin/ui_tag_chip_rare.png')!important}
.paper-action-dialog #companion-name-restore{width:160px;height:75px}
html[data-ui-target=competition] #home-view .arrival-copy{flex:1;min-width:0;text-align:right}
html[data-ui-target=competition] #home-view #cat-title{margin:12px 3px 3px}
html[data-ui-target=competition] #home-view .result-actions #inspect-cat{width:270px;max-width:100%;height:64px;padding:0 35px!important;font-size:15px!important;font-weight:600!important;background-image:url('../assets/skin/main_left.png'),url('../assets/skin/main_right.png'),url('../assets/skin/main_center.png')!important;background-position:left center,right center,53.333333px center!important;background-size:53.333333px 64px,46.666667px 64px,calc(100% - 100px) 64px!important;background-repeat:no-repeat!important}
.detail-rarity-emblem{width:27px;height:auto;object-fit:contain}.detail-rarity-emblem[hidden]{display:none}
html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long:not(.skin-fact-tall) dd,#catbox-detail-dialog .detail-list>.skin-fact-long:not(.skin-fact-tall) dd{height:72px;background-image:url('../assets/skin/fact_wide_300x72.png')}
html[data-ui-target=competition] #home-view button:disabled,#catbox-detail-dialog button:disabled,.paper-action-dialog button:disabled{opacity:1!important;filter:none!important;color:#8a755c!important}
@media(max-width:389px){html[data-ui-target=competition] #home-view .result-facts>.skin-fact-long:not(.skin-fact-tall) dd,#catbox-detail-dialog .detail-list>.skin-fact-long:not(.skin-fact-tall) dd{height:89.6px;background-image:url('../assets/skin/fact_wide_300x112.png')}}
@media(max-width:360px){html[data-ui-target=competition] #home-view .brand-logo{width:76px;max-width:76px}html[data-ui-target=competition] #home-view .header-actions{flex-wrap:nowrap;gap:2px}html[data-ui-target=competition] #home-view .header-actions button{padding:0;min-width:0}html[data-ui-target=competition] #home-view .catbox-entry-icon{width:18px}html[data-ui-target=competition] #home-view .catbox-entry-icon img{width:18px;height:auto}}
