#bonus{width:min(1180px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:20px;box-sizing:border-box}
#bonus .bonus-controls{margin:0 0 10px}
#bonus .bonus-controls button{font-size:10px;padding:9px 12px}
#bonus #bonus-reveal{display:none}
#bonus .encounter-heading{min-height:84px;padding:12px 18px;margin:0 0 14px;box-sizing:border-box}
#bonus .encounter-heading h2{font-size:22px;margin:0;padding:10px 14px}
#bonus .encounter-heading .pixel-creature{width:64px;height:64px}
#bonus #fantasy-area:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:20px;align-items:start}
#bonus .encounter-play,#bonus .encounter-information{min-width:0}
#bonus .encounter-person{margin:0 0 10px;gap:10px}
#bonus .role-portrait{width:42px;height:48px}
#bonus #fantasy-player{font-size:13px;line-height:1.7;margin:0}
#bonus .encounter-scene{padding:10px 12px;margin:0 0 10px}
#bonus #fantasy-story{font-size:12px;line-height:1.8;margin:0}
#bonus #fantasy-rules{font-size:12px;line-height:1.8;margin:0 0 12px;padding:10px 12px}
#bonus .d20-tray{margin:0 0 12px}
#bonus .d20-stage{height:280px}
#bonus .d20-caption{font-size:11px;padding-bottom:12px}
#bonus .encounter-play>.bonus-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0}
#bonus .encounter-play>.bonus-actions button{font-size:12px;line-height:1.6;padding:12px 10px;min-height:48px}
#bonus #fantasy-pass-note{font-size:9px;line-height:1.7;margin:8px 0 12px;text-align:left}
#bonus .fantasy-extra{padding:10px 0}
#bonus .fantasy-extra summary{font-size:11px;line-height:1.7}
#bonus .fantasy-extra p{font-size:11px}
#bonus #fantasy-item-note:empty{display:none}
#bonus #bonus-result{padding:12px 14px;margin:0 0 12px;border-radius:12px}
#bonus #bonus-result-title{font-size:16px;line-height:1.6}
#bonus #bonus-message{font-size:12px;line-height:1.8;margin:8px 0 0;white-space:pre-line}
#bonus #skill-allocation{padding:12px;margin:0;border-radius:12px}
#bonus #skill-allocation h3{font-size:12px;line-height:1.6}
#bonus #skill-allocation p{font-size:10px;line-height:1.8;margin:8px 0}
#bonus .skill-upgrade{font-size:10px;padding:8px 4px;min-height:64px;line-height:1.8}
#bonus .encounter-footer{position:sticky;bottom:-20px;background:#201b28;padding:12px 0 6px;margin:12px 0 0;z-index:2;border-top:1px solid #77618266}
#bonus .encounter-footer:has([hidden]):not(:has(button:not([hidden]))){display:none}
#bonus .encounter-footer button{font-size:13px;min-height:44px;padding:12px 18px}
#bonus:has(#bonus-result:not([hidden])) .encounter-play>.bonus-actions,#bonus:has(#bonus-result:not([hidden])) #fantasy-pass-note{display:none}
#bonus:has(#visit-panel:not([hidden])) #fantasy-area{grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr)}
@media(max-width:760px){#bonus{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:14px}#bonus #fantasy-area:not([hidden]),#bonus:has(#visit-panel:not([hidden])) #fantasy-area{display:flex;flex-direction:column;gap:14px}#bonus .encounter-information{order:0;width:100%}#bonus .encounter-play{order:1;width:100%}#bonus .encounter-heading h2{font-size:17px}#bonus .d20-stage{height:230px}#bonus .encounter-footer{bottom:-14px}#bonus .skill-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:761px){#bonus .d20-stage{height:250px}#bonus #bonus-result{margin:12px 0 0}#bonus #skill-allocation{margin-bottom:12px}} @media(max-width:760px){#bonus #fantasy-area:not([hidden]){display:flex}#bonus .encounter-play,#bonus .encounter-information{display:contents}#bonus .encounter-person{order:1}#bonus .encounter-scene{order:2}#bonus #fantasy-rules{order:3;width:100%;box-sizing:border-box}#bonus #visit-panel{order:4;width:100%}#bonus #fantasy-d20{order:5;width:100%}#bonus .encounter-play>.bonus-actions{order:6;width:100%}#bonus #fantasy-pass-note{order:7}#bonus #bonus-result{order:8;width:100%;box-sizing:border-box}#bonus #skill-allocation{order:9;width:100%;box-sizing:border-box}#bonus .fantasy-extra{order:10;width:100%}#bonus #fantasy-item-note{order:11}}
@media(min-width:761px){#bonus{padding:16px}#bonus .encounter-heading{min-height:66px;padding:8px 14px;margin-bottom:10px}#bonus .encounter-heading .pixel-creature{width:48px;height:48px}#bonus .skill-upgrade{min-height:50px;padding:6px 4px}#bonus .fantasy-extra{padding:8px 0}#bonus .encounter-footer{bottom:-16px;margin-top:8px;padding-top:8px}#bonus:has(#visit-panel:not([hidden])) #fantasy-area{display:block}#bonus:has(#visit-panel:not([hidden])) .encounter-play{display:none}}
@media(min-width:761px){#bonus:has(#visit-panel:not([hidden])) #fantasy-area{display:flex;flex-direction:column}#bonus:has(#visit-panel:not([hidden])) .encounter-information{order:0;width:100%}#bonus:has(#visit-panel:not([hidden])) .encounter-play{display:block;order:1;width:100%}}
#bonus .encounter-person{margin-bottom:8px}#bonus #fantasy-rules{margin-bottom:8px}#bonus #skill-allocation{margin-bottom:8px}

/* Results sit above the encounter; the scene and landed die remain behind. */
#bonus #encounter-summary{width:min(580px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #b49b70;border-radius:18px;background:#211b29;color:#f7f1ff;box-shadow:0 18px 65px #0009;overflow:hidden;box-sizing:border-box}
#bonus #encounter-summary[open]{display:flex;flex-direction:column}
#encounter-summary::backdrop{background:rgb(8 5 13 / 48%);backdrop-filter:none}
#encounter-summary .encounter-summary-body{min-height:0;overflow-y:auto;padding:24px 24px 8px;overscroll-behavior:contain}
#bonus #encounter-summary #bonus-result{border:0;background:none;box-shadow:none;margin:0 0 18px;padding:0;width:auto}
#bonus #encounter-summary #bonus-result-title{font-size:20px;line-height:1.65;color:#dfff00;margin:0 0 12px;outline:none;overflow-wrap:anywhere}
#bonus #encounter-summary #bonus-message{font-size:13px!important;line-height:1.9;margin:0;overflow-wrap:anywhere}
#encounter-summary #encounter-summary-skills{margin:0 0 10px;border:1px solid #655275;border-radius:10px;background:#2c2336}
#encounter-summary #encounter-summary-skills>summary{padding:14px 12px;color:#d9b564;font-size:11px;line-height:1.8;cursor:pointer}
#bonus #encounter-summary #skill-allocation{border:0;background:none;margin:0;padding:0 12px 12px;width:auto}
#bonus #encounter-summary #skill-allocation h3{display:none}
#bonus #encounter-summary #skill-allocation p{margin-top:0}
#bonus #encounter-summary .skill-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#bonus #encounter-summary .fantasy-extra{margin:0;width:auto;padding:12px 0}
#bonus #encounter-summary #fantasy-item-note{font-size:11px;line-height:1.8;color:#e1c174}
#encounter-summary .encounter-summary-footer{flex-shrink:0;padding:14px 24px 20px;border-top:1px solid #ffffff16;background:#211b29}
#bonus #encounter-summary #bonus-continue{width:100%;min-height:48px;font-size:13px;line-height:1.7;padding:12px;border-radius:12px}
#bonus #encounter-summary .item-grid{grid-template-columns:1fr 1fr;gap:8px}
#bonus #encounter-summary .item-tile{padding:10px;min-height:120px;gap:8px}
#bonus #encounter-summary .item-heading strong{font-size:11px;line-height:1.7}
#bonus #encounter-summary .item-effect,#bonus #encounter-summary .item-action,#bonus #encounter-summary .gold-balance{font-size:10px;line-height:1.7}
#bonus #encounter-summary .item-heading .pixel-item{width:28px;height:28px}
@media(max-width:480px){#encounter-summary .encounter-summary-body{padding:18px 16px 6px}#bonus #encounter-summary #bonus-result-title{font-size:17px}#bonus #encounter-summary #bonus-message{font-size:12px!important}#encounter-summary .encounter-summary-footer{padding:12px 16px 16px}#bonus #encounter-summary .item-grid{grid-template-columns:1fr}#bonus #encounter-summary .skill-upgrade{font-size:9px}}
@media(prefers-reduced-motion:no-preference){#encounter-summary[open]{animation:encounter-summary-enter .18s ease-out}@keyframes encounter-summary-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}}
