/* Shared hierarchy and accessible interaction states. */
:where(button,input,select,summary):focus-visible{outline:2px solid #f3d69d!important;outline-offset:3px}
:where(#optionsClose,#equipModalClose,#closeKeepsakes){min-width:44px;min-height:44px}
#keepsakeLivePreview{max-width:430px;margin:0 auto 18px;width:100%}
#keepsakeLivePreview .collection-preview{height:180px;position:relative}
#keepsakeLivePreview p{font:13px/1.5 system-ui;color:#c2cec7;margin:8px 0}
#keepsakeLivePreview svg{animation:none!important}
.story-set small{display:block;line-height:1.5;color:#c5cebf}
.story-set button[aria-pressed=true]{border-color:#e5c58b;background:#ba9f5429}
#keepsakeMenu .appearance-pane .keepsake-settings label{font-size:14px;line-height:1.5}
#keepsakeMenu .appearance-pane select{min-height:44px}
.daily-facts{padding:0;list-style:none;margin:0 0 20px;display:grid;gap:14px}
.daily-facts li{font:18px/1.4 Georgia;color:#ead6ad;padding-left:20px;position:relative}
.daily-facts li:before{content:'✦';position:absolute;left:0;font-size:12px;top:5px}
.daily-reward-note{font:14px/1.5 system-ui;color:#c6d0c9}
.daily-rule-details{margin-top:20px}.daily-rule-details summary,.term-help summary{cursor:pointer;color:#e2c68c;min-height:44px;padding:12px 0}
.term-help{font:13px/1.5 system-ui;border-top:1px solid #bba37135;margin-top:12px}.term-help p{margin:8px 0}


#offers .offer:has(button[aria-pressed=true]){border-color:#dcc387}
.creature-drop-ready,.item-drop-hover{outline:2px solid #d7cb91!important;outline-offset:3px}
.creature-drop-merge{outline:3px double #e3bd65!important;outline-offset:3px}
.creature-drop-merge:after{content:'Merge';position:absolute;right:6px;top:6px;background:#26382c;color:#f1d89d;padding:4px 8px;border-radius:4px;font:12px system-ui;pointer-events:none}
#itemDragGhost .drag-drop-label,#creatureDragGhost .drag-drop-label{font-weight:600;color:#f2dcae}
#collectionDetail{line-height:1.6}#collectionDetail .collection-effect{border-color:#baa36e55}
@media(max-height:500px){
 #keepsakeMenu .appearance-shell{width:min(900px,calc(100vw - 24px))}
 #keepsakeMenu .appearance-body{font-size:15px}
 #keepsakeLivePreview{max-width:300px;float:right;width:40%;margin:0 0 14px 20px}
 #keepsakeLivePreview .collection-preview{height:150px}
 .appearance-footer{clear:both}
 #keeperProgress{font-size:13px!important}
 .story-set p,.story-set small{font-size:14px!important}
 #guidedTutorHUD .gt-body{font-size:16px;line-height:1.45}
 #guidedTutorHUD{max-width:340px}
 #collectionDetail{font-size:16px}
 .daily-facts li{font-size:20px}
}
@media(prefers-reduced-motion:reduce){.collection-preview *,#keepsakeLivePreview *{animation:none!important;transition:none!important}}
/* v284 — shared control hierarchy and contextual reference */
:where(#optionsPanel,#keepsakeMenu,.collection-tabs,.result-tabs) button{touch-action:manipulation}
:where(#optionsPanel,#keepsakeMenu) button:disabled{opacity:.55;cursor:default}

#offers .offer-merge-ready{border-color:#d5c38c!important;box-shadow:inset 0 0 0 1px #d5c38c55}
.combat-term-link{display:inline!important;min-height:0!important;min-width:0!important;padding:0!important;margin:0!important;border:0!important;border-bottom:1px dotted #d1bc8e!important;border-radius:0!important;background:none!important;color:inherit!important;font:inherit!important;cursor:help}
.combat-term-dialog{position:fixed;z-index:100000;left:50%;top:50%;transform:translate(-50%,-50%);width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:22px;border:1px solid #c6ad79;border-radius:12px;background:#132630;box-shadow:0 0 0 100vmax #071019bb;color:#d4ddd5;font:15px/1.6 system-ui}
.combat-term-dialog h3{font:24px Georgia;color:#ecd6a9;margin:0 0 12px}.combat-term-dialog button{min-height:44px;padding:10px 16px;border:1px solid #baa372;background:#263b40;color:#eed8a6;border-radius:6px}
#keepsakeLivePreview{position:relative;overflow:hidden;padding:2px}
#keepsakeLivePreview .preview-theme-button{min-height:44px;width:100%;margin:6px 0 10px;border:1px solid #bba171;color:#eed6aa;background:linear-gradient(#344647,#1a3035);border-radius:7px}
#keepsakeLivePreview[data-frame=true] .preview-theme-button{background:var(--ui-button-top,#d8bf87);color:var(--ui-button-ink,#15272f);border-radius:var(--ui-radius,7px)}
.preview-hint{display:block;color:#c2cec3;font:12px/1.4 system-ui}
.keepsake-preview-particle{position:absolute;pointer-events:none;z-index:4;animation:previewDrift 1s ease-out both}
.keepsake-preview-particle.effect-moths img{width:25px;height:25px;object-fit:contain}.keepsake-preview-particle.effect-leaves{width:9px;height:15px;border-radius:85% 0;background:#b0ba78;box-shadow:inset 1px 0 #dce4b3}.keepsake-preview-particle.effect-embers{width:4px;height:4px;border-radius:50%;background:#f1cb85;box-shadow:0 0 7px #f3ac60}
#keepsakeLivePreview[data-flourish=true].preview-flash .mini-card{animation:previewFlourish .8s ease-out}
@keyframes previewDrift{from{opacity:.8;transform:translate(0,0) rotate(-15deg)}to{opacity:0;transform:translate(20px,-30px) rotate(35deg)}}
@keyframes previewFlourish{25%{box-shadow:0 0 24px #c7df93,0 0 6px #f3e6b8}100%{box-shadow:0 4px 8px #0004}}
#collectionDetail,#bestiaryDetail,#synergyDetail{line-height:1.55}
.collection-detail h3,.bestiary-detail h3{line-height:1.2}
#guidedTutorHUD{max-height:calc(100dvh - 24px)!important;overflow:auto}
#guidedTutorHUD .gt-body{line-height:1.5!important}
#guidedTutorHUD .gt-foot button{min-height:40px}
[data-tutorial-focus-child]{outline:none!important;box-shadow:none!important}
@media(max-height:500px){
 #keepsakeMenu .appearance-shell{max-height:calc(100dvh - 16px)!important}
 #keepsakeMenu .appearance-body{overflow:auto;overscroll-behavior:contain}
 #keepsakeMenu .appearance-pane{min-height:0}
 
 #guidedTutorHUD .gt-body{font-size:14px!important}
 #guidedTutorHUD .gt-title{font-size:19px!important}
 #guidedTutorHUD .gt-foot{font-size:12px}
 #collectionDetail,#bestiaryDetail,#synergyDetail{font-size:15px}
 .collection-detail .collection-effect{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.keepsake-preview-particle{display:none}#keepsakeLivePreview *{animation:none!important}}
/* v285: the close target must sit above heading/tabs across its entire area. */
#optionsPanel #optionsClose{position:absolute!important;top:8px!important;right:8px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:10px!important;display:grid!important;place-items:center!important;z-index:20!important;pointer-events:auto!important;transform:none!important;touch-action:manipulation;border:1px solid #c3ab7466!important;border-radius:7px!important;background:#152a33!important}
#optionsPanel #optionsClose svg{width:20px;height:20px;pointer-events:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
#optionsPanel .game-menu-heading{padding-right:52px!important;min-height:44px!important}
#optionsPanel .compact-tabs{position:relative;z-index:1}
#optionsPanel #optionsAudio{min-height:0}
#optionsPanel .audio-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
#optionsPanel #audioMute{min-width:90px;min-height:44px}
#optionsPanel input[type=range]{min-height:32px;touch-action:pan-x}
