/* Realm diagnostic UI — contained inside the existing game viewport, not physics. */
#canvasWrap {position:relative;}
#kf-realm-hud {position:absolute;z-index:62;top:48px;right:11px;max-width:min(348px,calc(100% - 16px));min-width:225px;background:rgba(5,23,34,.91);color:#dcf8f0;border:1px solid rgba(116,223,180,.72);border-radius:11px;box-shadow:0 10px 26px rgba(0,0,0,.4);font:12px/1.45 system-ui,Segoe UI,Arial,sans-serif;pointer-events:auto;}
#kf-realm-hud[data-mode="original"] {border-color:rgba(154,177,193,.7);}
#kf-realm-hud button,#kf-realm-hud select {background:#163848;color:#e8fffa;border:1px solid #568977;border-radius:6px;padding:7px 9px;font:700 11px system-ui,sans-serif;cursor:pointer;min-width:0;}
#kf-realm-hud button:focus-visible,#kf-realm-hud select:focus-visible{outline:2px solid #bafce1;outline-offset:2px;}
#kf-realm-hud button:hover{background:#205965;}
#kf-realm-hud .kf-realm-line{display:flex;align-items:center;gap:7px;padding:5px 7px;}
#kfRealmSwitch{flex:1 1 auto;white-space:nowrap;}
#kfRealmPerf{white-space:nowrap;color:#a6f1c6;font:700 10px monospace;}
#kfRealmExpand{flex:0 0 28px;}
#kfRealmPanel{border-top:1px solid #31544e;padding:10px 11px 12px;}
#kfRealmPanel[hidden]{display:none!important;}
#kfRealmPanel p{font-size:11px;opacity:.86;margin:0 0 10px;}
#kfRealmPanel label{display:block;font-size:10px;margin-bottom:3px;text-transform:uppercase;color:#b8e4d0;letter-spacing:.08em;}
#kfRealmQuality{width:100%;}
#kfRealmDetails{white-space:pre-wrap;line-height:1.7;font:11px/1.6 ui-monospace,Consolas,monospace;padding:8px 0;color:#a9decd;}
#kfRealmPanel .kf-realm-actions{display:flex;gap:6px;}
#kfRealmPanel .kf-realm-actions button{flex:1;}
#kfRealmPanel small{display:block;margin-top:8px;opacity:.75;}
#scene.kf-realm-grade{filter:saturate(1.04) contrast(1.015);}
@media(max-width:720px){#kf-realm-hud{top:70px;right:6px;min-width:0;max-width:95%;}#kfRealmPerf{font-size:9px;}}
#kfRealmPanel{max-height:min(60vh,390px);overflow-y:auto;overscroll-behavior:contain;}
html.kf-racing #kf-realm-hud{position:fixed;top:61px;right:12px;z-index:192;}
@media(max-width:720px){html.kf-racing #kf-realm-hud{top:58px;right:7px;}}
