/* The painted kit: every piece painted by Codex on magenta and cut out (assets/ui/kit/ui-v2-*.webp); texts stay HTML.
   Frames are 9-slice border-images: corners fixed, sides stretched. Sizes follow the 16:9 stage (cqw).
   A framed panel draws its frame in ::after (above the content's corners, no clicks) and its ground in ::before, inset
   by the frame's band only, because the corner slice is larger than the band (the carving runs along the sides). */
@font-face{font-family:'Cormorant Garamond';src:url('../assets/fonts/cormorant-garamond.woff2') format('woff2');font-weight:300 700;font-display:swap}
@font-face{font-family:'Libre Baskerville';src:url('../assets/fonts/libre-baskerville.woff2') format('woff2');font-weight:400 700;font-display:swap}
@font-face{font-family:'Libre Baskerville';font-style:italic;src:url('../assets/fonts/libre-baskerville-italic.woff2') format('woff2');font-weight:400;font-display:swap}

:root{
  --kit-gold:#e9bc6c;--kit-gold-mid:#c5a56c;--kit-bronze:#82501b;
  --kit-green:#001b16;--kit-green-deep:#01110b;--kit-ivory:#ece5ca;
  --kit-display:'Cormorant Garamond',Georgia,serif;--kit-text:'Libre Baskerville',Georgia,serif;
  --kit-scale:1;
}
#app.large-text{--kit-scale:1.22}
#app.immersive .stage{container:stage/size}
#app.immersive .hud,#app.immersive .vn,.panel-pause,#app.immersive .activity-drawer{font-family:var(--kit-text)}

/* Shared pieces: engraved icons, round medallions, wooden and green plates. */
.kit-icon{display:block;width:62%;height:62%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 1px 1px #000c)}
.kit-medallion{position:relative;display:grid;place-items:center;flex:none;width:clamp(44px,4.1cqw,66px);height:clamp(44px,4.1cqw,66px);padding:0;border:0;border-radius:50%;background:url('../assets/ui/kit/ui-v2-medaglione.webp') center/100% 100% no-repeat;box-shadow:0 3px 10px #000a;transition:filter .15s,transform .1s}
/* The old generic button:hover resets the whole background: the painted ground is restated. */
.kit-medallion:hover:not(:disabled){border:0;background:url('../assets/ui/kit/ui-v2-medaglione.webp') center/100% 100% no-repeat;filter:brightness(1.18) drop-shadow(0 0 7px #e9bc6c99)}
.kit-medallion:active:not(:disabled){transform:translateY(1px);filter:brightness(.88)}
.kit-medallion:disabled{filter:grayscale(.7) brightness(.7)}
#app.immersive .kit-medallion.muted{opacity:1}
.kit-medallion.muted .kit-icon{opacity:.7}
.kit-medallion.has-new,.kit-medallion.selected{filter:drop-shadow(0 0 8px #e9bc6ccc)}
.kit-medallion:focus-visible,.kit-plate:focus-visible,.activity:focus-visible,.hotspot:focus-visible{outline:2px solid var(--kit-ivory);outline-offset:3px}
.kit-badge{position:absolute;right:-4px;top:-4px;min-width:1.7em;padding:.15em .35em;border-radius:1em;background:var(--kit-green);border:1px solid var(--kit-gold);color:var(--kit-ivory);font:700 calc(clamp(10px,.75cqw,13px) * var(--kit-scale))/1.2 var(--kit-text);text-align:center}
.kit-badge.dot{min-width:0;width:12px;height:12px;padding:0;background:#8c1f17}
.kit-plate{display:inline-flex;align-items:center;justify-content:center;gap:.6em;min-height:44px;padding:0 2.2em;border:0;border-style:solid;border-width:0 var(--plate-end,26px);border-image:url('../assets/ui/kit/ui-v2-pulsante-legno.webp') 0 var(--plate-cut,80) fill / 0 var(--plate-end,26px) / 0 stretch;background:none;color:var(--kit-ivory);font:600 calc(clamp(15px,1.2cqw,20px) * var(--kit-scale))/1.1 var(--kit-display);letter-spacing:.02em;text-shadow:0 1px 2px #000,0 0 6px #000a;transition:filter .15s,transform .1s}
.kit-plate-green{border-image-source:url('../assets/ui/kit/ui-v2-pulsante-verde.webp');--plate-cut:96}
.kit-plate:hover:not(:disabled),.kit-plate.open{border-color:transparent;background:none;color:#fff3d6;filter:brightness(1.15) drop-shadow(0 0 6px #e9bc6c88)}
.kit-plate:active:not(:disabled){transform:translateY(1px);filter:brightness(.9)}
.kit-plate.primary{background:none;border-color:transparent;color:var(--kit-ivory);font-weight:600}
.kit-plate.primary svg{width:16px;height:16px}
.kit-count{display:inline-grid;place-items:center;min-width:1.5em;height:1.5em;border-radius:50%;background:var(--kit-green-deep);border:1px solid var(--kit-gold);font:700 .72em/1 var(--kit-text)}
.kit-rule{border:0;height:2px;margin:14px 8%;background:linear-gradient(90deg,transparent,var(--kit-bronze),var(--kit-gold),var(--kit-bronze),transparent)}

/* Framed panels: the shaped frame (acanthus breaking out of the corners, opening at 98/176, rounded ~61/176). */
.kit-panel,.modal:is(.panel-pause,.panel-map,.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics),.modal.interaction-modal:has(.dialogue-layout),.modal.interaction-modal:has(.reflection-puzzle){--frame-cut:176;--frame-band:.53;--frame-round:.35;--frame-w:64px;position:relative;isolation:isolate;padding:var(--frame-w);border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
.kit-panel::before,.modal:is(.panel-pause,.panel-map,.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics)::before,.modal.interaction-modal:has(.dialogue-layout)::before,.modal.interaction-modal:has(.reflection-puzzle)::before{content:'';position:absolute;inset:calc(var(--frame-w) * var(--frame-band));z-index:-1;border-radius:calc(var(--frame-w) * var(--frame-round));background:url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green);box-shadow:0 18px 50px #000c}
.kit-panel::after,.modal:is(.panel-pause,.panel-map,.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics)::after,.modal.interaction-modal:has(.dialogue-layout)::after,.modal.interaction-modal:has(.reflection-puzzle)::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-style:solid;border-width:var(--frame-w);border-image:url('../assets/ui/kit/ui-v2-cornice-grande.webp') 176 / var(--frame-w) / 0 stretch}
.modal>.close-modal.kit-medallion{position:absolute;top:10px;right:10px;z-index:3;width:44px;height:44px;padding:0}
.modal:is(.panel-pause,.panel-map,.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics)>.close-modal,.modal.interaction-modal:has(.dialogue-layout)>.close-modal,.modal.interaction-modal:has(.reflection-puzzle)>.close-modal{top:calc(var(--frame-w) * .1);right:calc(var(--frame-w) * .1)}
.modal:is(.panel-pause,.panel-map,.panel-journal,.panel-inventory,.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics,.interaction-modal):focus{outline:none}
.kit-panel-body{max-height:inherit;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--kit-bronze) transparent}
/* The body of a panel scrolls within the viewport; the frame stays. */
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics,.panel-map) .panel-body{max-height:calc(100dvh - var(--frame-w) * 2 - 24px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--kit-bronze) transparent}
/* The crest at the top centre of a panel; its oval holds a little green enamel, so it is not a hole. */
.panel-body>h2:first-of-type:not(.pause-title)::before{content:'';position:absolute;left:50%;top:0;width:190px;aspect-ratio:320/160;transform:translate(-50%,-34%);background:url('../assets/ui/kit/ui-v2-cimiero.webp') center/contain no-repeat,radial-gradient(ellipse 9.5% 29% at 50% 46%,#0b3328 0,#04170f 96%,transparent 100%);pointer-events:none;z-index:2}
.modal:is(.panel-journal,.panel-map,.panel-inventory) .panel-body>h2:first-of-type::before{content:none}

/* Scene: location plaque top left, two medallions top right. */
#app.immersive .hud-top{background:none;padding:clamp(8px,1.1cqw,18px)}
#app.immersive .kit-location{--k:.44;padding:.2em .9em .3em;border-style:solid;border-width:calc(36px * var(--k)) calc(104px * var(--k));border-image:url('../assets/ui/kit/ui-v2-targa-luogo.webp') 36 104 fill / calc(36px * var(--k)) calc(104px * var(--k)) / 0 stretch;text-shadow:0 1px 2px #000}
#app.immersive .kit-location .eyebrow{font:600 calc(clamp(11px,.8cqw,14px) * var(--kit-scale))/1.2 var(--kit-text);letter-spacing:.08em;color:var(--kit-gold-mid);text-transform:uppercase}
#app.immersive .kit-location h1{font:600 calc(clamp(22px,2.3cqw,38px) * var(--kit-scale))/1.05 var(--kit-display);color:var(--kit-ivory)}
#app.immersive .kit-location h1:focus{outline:none}
#app.immersive .kit-location .hud-sub{font:italic calc(clamp(11px,.85cqw,15px) * var(--kit-scale))/1.3 var(--kit-text);color:#d9cba6}
#app.immersive .hud-tools{gap:clamp(6px,.6cqw,10px)}
#app.immersive .hud .scene-caption{border:1px solid #c5a56c88;border-left:3px solid var(--kit-gold);background:linear-gradient(#00100ce6,#00100ce6),url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat;box-shadow:0 6px 20px #000a;color:var(--kit-ivory);font:italic calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.5 var(--kit-text)}

/* Scene: the tray of the search, with the lens, the journal, the bag and the places; the fleur-de-lis on top. */
#app.immersive .hud-bottom.kit-tray{--tray-k:.36;position:relative;align-items:center;gap:clamp(10px,1.2cqw,22px);margin:0 clamp(6px,.8cqw,14px) clamp(4px,.5cqw,8px);padding:clamp(2px,.3cqw,6px) 0;background:none;border-style:solid;border-width:calc(64px * var(--tray-k)) calc(220px * var(--tray-k)) calc(44px * var(--tray-k));border-image:url('../assets/ui/kit/ui-v2-vassoio.webp') 64 220 44 fill / calc(64px * var(--tray-k)) calc(220px * var(--tray-k)) calc(44px * var(--tray-k)) / 0 stretch;pointer-events:auto}
#app.immersive .kit-tray::before{content:'';position:absolute;left:50%;top:0;width:clamp(48px,4.2cqw,72px);aspect-ratio:160/96;transform:translate(-50%,-62%);background:url('../assets/ui/kit/ui-v2-fregio-giglio.webp') center/contain no-repeat;pointer-events:none}
#app.immersive .tray-tools{display:flex;align-items:center;gap:clamp(6px,.7cqw,12px)}
#app.immersive .kit-tray .kit-lens{width:clamp(52px,5cqw,80px);height:clamp(52px,5cqw,80px)}
#app.immersive .kit-tray .hud-question{flex:1;max-width:none;min-width:0;color:var(--kit-ivory);font:calc(clamp(13px,1cqw,17px) * var(--kit-scale))/1.35 var(--kit-text);text-shadow:0 1px 2px #000}
#app.immersive .kit-tray .hud-question>span:last-child{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
#app.immersive .kit-tray .hud-question .tiny-label{font:600 calc(clamp(10px,.75cqw,13px) * var(--kit-scale))/1.2 var(--kit-text);letter-spacing:.08em;text-transform:uppercase;color:var(--kit-gold-mid)}
#app.immersive .kit-tray .hud-controls{flex-wrap:nowrap}
#app.immersive .kit-tray .hud-controls>*{white-space:nowrap}

/* Activity drawer: the medium shaped frame (512 px, corners within 112, opening at 62), above the tray on the right. */
#app.immersive .activity-drawer{--frame-cut:112;--frame-band:.55;--frame-round:.21;--frame-w:48px;position:absolute;right:clamp(10px,1.2cqw,22px);bottom:calc(clamp(52px,5cqw,80px) + 39px + clamp(16px,1.6cqw,26px));z-index:6;width:min(30cqw,440px);min-width:280px;pointer-events:auto;color:var(--kit-ivory)}
#app.immersive .activity-drawer::after{border-image:url('../assets/ui/kit/ui-v2-cornice-media.webp') 112 / var(--frame-w) / 0 stretch}
#app.immersive .activity-drawer .kit-panel-body{max-height:calc(62cqh - 92px);margin:-14px -10px;padding:4px 6px}
.activity-drawer h3{margin:10px 6px 6px;font:600 calc(clamp(13px,.95cqw,16px) * var(--kit-scale))/1.2 var(--kit-text);letter-spacing:.1em;text-transform:uppercase;color:var(--kit-gold)}
.activity-drawer .activity{display:flex;align-items:center;gap:12px;width:100%;padding:8px 10px;border:1px solid transparent;border-radius:4px;text-align:left;font:calc(clamp(14px,1.05cqw,18px) * var(--kit-scale))/1.3 var(--kit-text);color:var(--kit-ivory)}
.activity-drawer .activity .kit-icon{width:30px;height:30px;flex:none}
.activity-drawer .activity small{display:block;margin-top:2px;font:italic calc(clamp(11px,.8cqw,14px) * var(--kit-scale))/1.3 var(--kit-text);color:#cdbd97}
.activity-drawer .activity:hover:not(:disabled){border-color:#e9bc6c66;background:#e9bc6c1a}
.activity-drawer .activity.examined{opacity:.72}
.activity-drawer .examined-toggle{width:100%;margin-top:6px;padding:8px;border-top:1px solid #e9bc6c44;font:italic calc(clamp(12px,.9cqw,15px) * var(--kit-scale))/1.3 var(--kit-text);color:var(--kit-gold-mid)}
.activity-empty{margin:12px;font:italic calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.5 var(--kit-text)}
.activity-drawer .activity-go{margin:0 12px 12px}

/* Points on the painting: a brass medallion for things and ways out, a gold cameo for portraits; people standing in the
   picture have the medallion at hand height (their feet are where the tray lies), opening into a name cartouche. */
#app.immersive .hotspot .spot-ring{width:clamp(30px,2.6cqw,42px);height:clamp(30px,2.6cqw,42px);border:0;border-radius:50%;background:url('../assets/ui/kit/ui-v2-punto.webp') center/100% 100% no-repeat;box-shadow:0 2px 8px #000c;opacity:.92;animation:kit-glint 4.5s ease-in-out infinite}
#app.immersive .hotspot .spot-ring .kit-icon{width:64%;height:64%}
#app.immersive .hotspot.observed .spot-ring{opacity:.55;animation:none;filter:saturate(.6)}
#app.immersive .hotspot:hover .spot-ring,#app.immersive .hotspot:focus-visible .spot-ring,#app.immersive .hotspot.lit .spot-ring,#app.immersive .hotspot.revealed .spot-ring{opacity:1;transform:scale(1.25);filter:brightness(1.15) drop-shadow(0 0 10px #f3d38bcc);animation:none}
#app.immersive .hotspot .spot-label,#app.immersive .actor-spot:is(:hover,:focus-visible,.revealed,.lit) .actor-label{font:600 calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.2 var(--kit-text);color:var(--kit-ivory);background:none;border-style:solid;border-width:7px 20px;border-image:url('../assets/ui/kit/ui-v2-targhetta-nome.webp') 16 48 fill / 7px 20px / 0 stretch;padding:7px 10px;text-shadow:0 1px 2px #000}
#app.immersive .hotspot.lit .spot-label,#app.immersive .hotspot.lit .actor-label{opacity:1}
#app.immersive .actor-label{display:grid;place-items:center;gap:6px;width:clamp(30px,2.6cqw,42px);height:clamp(30px,2.6cqw,42px);min-width:0;min-height:0;padding:0;border:0;border-radius:50%;background:url('../assets/ui/kit/ui-v2-punto.webp') center/100% 100% no-repeat;box-shadow:0 2px 8px #000c;animation:kit-glint 4.5s ease-in-out infinite}
#app.immersive .actor-spot .actor-label{bottom:34%}
#app.immersive .actor-label .kit-icon{width:64%;height:64%}
#app.immersive .actor-spot.observed .actor-label{opacity:.6;animation:none}
#app.immersive .actor-spot:is(:hover,:focus-visible,.revealed,.lit) .actor-label{display:flex;width:auto;height:auto;border-radius:0;box-shadow:none;animation:none;opacity:1}
#app.immersive .actor-spot:is(:hover,:focus-visible,.revealed,.lit) .actor-label .kit-icon{width:20px;height:20px}
#app.immersive .actor-spot.lit .actor-name{display:inline}
#app.immersive .person-medallion{border:0;border-radius:50%;position:relative;overflow:visible;box-shadow:none}
#app.immersive .person-medallion img{border-radius:50%}
#app.immersive .person-medallion::after{content:'';position:absolute;inset:-27% -20% -30%;background:url('../assets/ui/kit/ui-v2-cammeo.webp') center/100% 100% no-repeat;pointer-events:none}
@keyframes kit-glint{0%,82%,100%{filter:none}90%{filter:brightness(1.35) drop-shadow(0 0 9px #f3d38b)}}

/* Dialogue: the shaped low frame (opening at 58/144 from the top, 40/144 from the sides); the name on a cartouche. */
#app.immersive .vn-band{--frame-w:clamp(48px,4.6cqw,72px);left:3%;right:3%;bottom:2%;isolation:isolate;padding:calc(var(--frame-w) * .55) calc(var(--frame-w) * .75) calc(var(--frame-w) * .5);background:none}
#app.immersive .vn-band::before{content:'';position:absolute;inset:calc(var(--frame-w) * .38) calc(var(--frame-w) * .26);z-index:-1;border-radius:calc(var(--frame-w) * .12);background:linear-gradient(#00100cd8,#00100ce8),url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green);box-shadow:0 12px 40px #000c}
#app.immersive .vn-band::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-style:solid;border-width:var(--frame-w);border-image:url('../assets/ui/kit/ui-v2-cornice-dialogo-2.webp') 144 / var(--frame-w) / 0 stretch}
#app.immersive .vn-name{position:absolute;z-index:2;top:0;left:calc(var(--frame-w) * 1.6);transform:translateY(-30%);margin:0;padding:6px 2.2em;border-style:solid;border-width:8px 24px;border-image:url('../assets/ui/kit/ui-v2-targhetta-nome.webp') 16 48 fill / 8px 24px / 0 stretch;font:600 calc(clamp(18px,1.6cqw,26px) * var(--kit-scale))/1.1 var(--kit-display);color:var(--kit-ivory);text-shadow:0 1px 2px #000}
#app.immersive .vn-name::after{display:none}
#app.immersive .voice-right .vn-name{left:auto;right:calc(var(--frame-w) * 1.6)}
#app.immersive .vn-meta{font:italic calc(clamp(11px,.8cqw,13px) * var(--kit-scale))/1.2 var(--kit-text);color:#cdbd97;letter-spacing:.04em}
#app.immersive .vn-text,#app.immersive .vn-question{font-family:var(--kit-text);color:var(--kit-ivory)}
#app.immersive .vn-close{border:0;background:none;color:#cdbd97;font:italic calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.2 var(--kit-text);text-decoration:underline;text-underline-offset:4px}
#app.immersive .vn-choices button{border:1px solid #c5a56c66;border-radius:2px;background:linear-gradient(#0c2a22,#04160f);box-shadow:inset 0 1px 0 #e9bc6c22,0 2px 6px #0008;color:var(--kit-ivory);font:calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.35 var(--kit-text)}
#app.immersive .vn-choices button:hover:not(:disabled){border-color:var(--kit-gold);background:linear-gradient(#123a2f,#072019);color:#fff3d6}
#app.immersive .vn-choices button[aria-pressed="true"]{border-color:var(--kit-gold);box-shadow:inset 0 0 0 1px var(--kit-gold),0 0 10px #e9bc6c55}
#app.immersive .vn-choices button:focus-visible{outline:2px solid var(--kit-ivory);outline-offset:2px}

/* Close-up observations: a picture beside the text, in the framed panel; crest on top, pendant below. */
.modal.interaction-modal:has(.dialogue-layout){--frame-w:66px;max-height:none}
.modal.interaction-modal:has(.dialogue-layout) .dialogue-layout{max-height:calc(100dvh - var(--frame-w) * 2 - 24px);overflow:auto}
.modal.interaction-modal:has(.dialogue-layout) .dialogue-layout::before{content:'';position:absolute;z-index:2;left:50%;top:0;width:180px;aspect-ratio:320/160;transform:translate(-50%,-30%);background:url('../assets/ui/kit/ui-v2-cimiero.webp') center/contain no-repeat,radial-gradient(ellipse 9.5% 29% at 50% 46%,#0b3328 0,#04170f 96%,transparent 100%);pointer-events:none}
.modal.panel-pause .pause-leave::after,.modal.interaction-modal:has(.dialogue-layout) .dialogue-copy::after{content:'';position:absolute;z-index:2;left:50%;bottom:0;width:150px;aspect-ratio:240/96;transform:translate(-50%,42%);background:url('../assets/ui/kit/ui-v2-pendente.webp') center/contain no-repeat;pointer-events:none}
.modal.interaction-modal .dialogue-layout{background:none;color:var(--kit-ivory);font-family:var(--kit-text)}
.footer-done{display:none}
.modal.interaction-modal .dialogue-copy{background:#00100c99}
.modal.interaction-modal .dialogue-copy h2{font:600 calc(clamp(24px,2.2vw,34px) * var(--kit-scale))/1.1 var(--kit-display);color:var(--kit-gold)}
.modal.interaction-modal .dialogue-copy .eyebrow,.modal.interaction-modal .dialogue-footer>span{font:italic calc(clamp(11px,.8vw,14px) * var(--kit-scale))/1.3 var(--kit-text);color:#cdbd97;text-transform:none;letter-spacing:.03em}
.modal.interaction-modal .dialogue-text{font-family:var(--kit-text);color:var(--kit-ivory)}
.modal.interaction-modal .detail-image{border:1px solid #c5a56c88;box-shadow:0 4px 16px #000a}
.modal.interaction-modal .dialogue-choices button{border:1px solid #c5a56c66;background:linear-gradient(#0c2a22,#04160f);color:var(--kit-ivory);font-family:var(--kit-text)}
.modal.interaction-modal .dialogue-choices button:hover:not(:disabled){border-color:var(--kit-gold)}

/* Pause: the framed panel, resume first, leaving the game apart under a brass rule. */
.modal.panel-pause{--frame-w:70px;width:min(460px,94vw);color:var(--kit-ivory)}
.panel-pause .close-modal{display:none}
.modal h2.pause-title{margin:4px 0 20px;text-align:center;font:600 calc(clamp(28px,2.4cqw,40px) * var(--kit-scale))/1 var(--kit-display);color:var(--kit-gold);text-shadow:0 2px 3px #000}
.modal.panel-pause .pause-title::before{content:'';display:block;width:min(210px,52%);height:auto;aspect-ratio:320/160;margin:calc(var(--frame-w) * -1.55) auto 2px;background:url('../assets/ui/kit/ui-v2-cimiero.webp') center/contain no-repeat,radial-gradient(ellipse 9.5% 29% at 50% 46%,#0b3328 0,#04170f 96%,transparent 100%);filter:drop-shadow(0 2px 3px #000a)}
.pause-list{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.pause-list .kit-plate{min-height:52px;justify-content:flex-start;padding-left:1.4em}
.pause-list .kit-plate .kit-icon{width:24px;height:24px}
.pause-leave .kit-plate{min-height:44px;font-size:calc(clamp(14px,1.05cqw,18px) * var(--kit-scale));filter:saturate(.85)}

/* Watson's hint and the notices on the gilded scroll (ends rolled into acanthus; green inside). */
#app.immersive .hint-note,.toast{--k:.62;border:0;border-style:solid;border-width:calc(50px * var(--k)) calc(128px * var(--k)) calc(49px * var(--k));border-image:url('../assets/ui/kit/ui-v2-cartiglio-avviso.webp') 50 128 49 fill / calc(50px * var(--k)) calc(128px * var(--k)) calc(49px * var(--k)) / 0 stretch;background:none;box-shadow:none;filter:drop-shadow(0 6px 14px #000b)}
#app.immersive .hint-note{align-self:flex-start;margin:-4px clamp(8px,1.1cqw,18px) auto clamp(0px,.5cqw,8px);max-width:min(520px,44cqw);padding:0 4px;pointer-events:auto;color:var(--kit-ivory);font:calc(clamp(13px,1cqw,16px) * var(--kit-scale))/1.45 var(--kit-text)}
#app.immersive .hint-note p{margin:0 0 8px}
#app.immersive .hint-title{font:italic 600 calc(clamp(12px,.85cqw,14px) * var(--kit-scale))/1.2 var(--kit-text);letter-spacing:.06em;color:var(--kit-gold)}
#app.immersive .hint-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#app.immersive .hint-actions .kit-plate{min-height:38px;font-size:calc(clamp(14px,1cqw,17px) * var(--kit-scale))}
.toast{max-height:none;overflow:visible;padding:0 6px;color:var(--kit-ivory);font:calc(15px * var(--kit-scale,1))/1.45 var(--kit-text)}
.toast button{color:var(--kit-gold)}

/* Watson's notebook: green leather cover (brass corners within 80 px), two paper pages with the spine between them,
   ribbon bookmarks standing out of the top edge (turned so the swallowtail is on top; the label stays upright). */
.modal.panel-journal{width:min(1180px,96vw);max-height:none;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;margin-top:44px}
.modal.panel-journal>.close-modal{top:-18px;right:-18px}
.notebook{--cover:clamp(26px,3vw,40px);position:relative;isolation:isolate;display:grid;grid-template-columns:1fr 1fr;column-gap:clamp(30px,3.4vw,46px);height:min(80dvh,740px);padding:var(--cover);background:url('../assets/ui/kit/ui-v2-taccuino-dorso.webp') center/clamp(30px,3.4vw,46px) 100% no-repeat,linear-gradient(90deg,#0d2419,#16352a 50%,#0d2419);border-radius:14px;box-shadow:0 24px 60px #000d,0 0 0 1px #00000080}
.notebook::after{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;border-style:solid;border-width:var(--cover);border-image:url('../assets/ui/kit/ui-v2-taccuino-copertina.webp') 80 / var(--cover) / 0 stretch}
.notebook-page{position:relative;min-height:0;overflow:auto;padding:clamp(22px,2.4vw,36px) clamp(22px,2.6vw,40px);background:url('../assets/ui/kit/ui-v2-carta.webp') center/100% 100% no-repeat,#ecdcb8;color:#3a2414;font:calc(15px * var(--kit-scale,1))/1.6 var(--kit-text);scrollbar-width:thin;scrollbar-color:#9b7a4c transparent}
.page-left{box-shadow:inset -18px 0 22px -14px #5a3a1a66}
.page-right{box-shadow:inset 18px 0 22px -14px #5a3a1a66}
.journal-heading{margin:0 0 4px;font:600 calc(clamp(24px,2.3vw,34px) * var(--kit-scale,1))/1.1 var(--kit-display);color:#2c1a0c}
.journal-objective{margin:0 0 14px;padding-left:10px;border-left:2px solid #9b2a1e;font-style:italic;color:#5a3a1a}
.journal-filters{display:flex;flex-wrap:wrap;gap:4px 12px;margin:0 0 10px}
.journal-filters button{padding:2px 0;border:0;border-bottom:1px solid transparent;border-radius:0;background:none;color:#7a5a32;font:italic calc(13px * var(--kit-scale,1))/1.3 var(--kit-text)}
.journal-filters button[aria-pressed="true"]{color:#2c1a0c;border-bottom-color:#9b2a1e}
.journal-filters button:hover:not(:disabled){background:none;color:#2c1a0c;border-color:#9b7a4c}
.journal-list{display:flex;flex-direction:column}
.journal-line{display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;border:0;border-bottom:1px dotted #9b7a4c88;border-radius:0;background:none;color:#3a2414;text-align:left;font:calc(15px * var(--kit-scale,1))/1.35 var(--kit-text)}
.journal-line:hover:not(:disabled){background:#c5a56c26;color:#1c0c04;border-color:#9b7a4c}
.journal-line[aria-pressed="true"]{background:#c5a56c40;font-weight:700;color:#1c0c04}
.journal-line:focus-visible,.journal-filters button:focus-visible,.bookmark:focus-visible{outline:2px solid #9b2a1e;outline-offset:1px}
.journal-new{flex:none;width:24px;height:24px;background:url('../assets/ui/kit/ui-v2-sigillo-nuovo.webp') center/contain no-repeat}
.journal-empty{font-style:italic;color:#6a4a2a}
.page-right h3{margin:4px 0 12px;font:600 calc(clamp(24px,2.2vw,32px) * var(--kit-scale,1))/1.15 var(--kit-display);color:#2c1a0c}
.journal-kind{margin:0;font:italic calc(13px * var(--kit-scale,1))/1.3 var(--kit-text);letter-spacing:.04em;color:#8a5a2a;text-transform:uppercase}
.journal-photo{position:relative;margin:0 auto 16px;width:min(86%,420px);padding:8px;background:#f6efdc;box-shadow:0 3px 10px #3a241455;transform:rotate(-1.2deg)}
.journal-photo img{width:100%;height:auto}
/* Photo corners: one painted corner, mirrored for the opposite one. */
.journal-photo::before,.journal-photo::after{content:'';position:absolute;width:34px;height:34px;background:url('../assets/ui/kit/ui-v2-angolini.webp') center/contain no-repeat;pointer-events:none}
.journal-photo::before{left:-6px;top:-6px}
.journal-photo::after{right:-6px;bottom:-6px;transform:scale(-1,-1)}
.journal-portrait{width:min(52%,220px)}
.bookmarks{position:absolute;left:calc(var(--cover) + 24px);top:0;z-index:3;display:flex;gap:10px;transform:translateY(-100%)}
.bookmark{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:center;width:clamp(88px,8vw,116px);min-height:80px;padding:30px 6px 10px;border:0;border-radius:0;background:none;color:#f6ead0;font:600 calc(15px * var(--kit-scale,1))/1.1 var(--kit-display);text-shadow:0 1px 2px #0009;transition:transform .15s,filter .15s}
.bookmark::before{content:'';position:absolute;inset:0;z-index:-1;background:var(--ribbon) center bottom/100% auto no-repeat;transform:scaleY(-1);filter:drop-shadow(0 2px 3px #0008)}
.bookmark small{font:calc(11px * var(--kit-scale,1))/1.2 var(--kit-text);opacity:.85}
.bookmark-rosso{--ribbon:url('../assets/ui/kit/ui-v2-segnalibro-rosso.webp')}
.bookmark-verde{--ribbon:url('../assets/ui/kit/ui-v2-segnalibro-verde.webp')}
.bookmark-blu{--ribbon:url('../assets/ui/kit/ui-v2-segnalibro-blu.webp')}
.bookmark[aria-pressed="true"]{transform:translateY(-8px);filter:brightness(1.15)}
.bookmark:hover:not(:disabled){transform:translateY(-4px);filter:brightness(1.1);border:0;background:none}
/* The notebook, clearer (proposal of Codex, giro-taccuino): the filters are small cartouches you can tell are buttons; the
   chosen line has a red notch and its title is echoed in red on the right page; new notes say «Nuovo»; each line ends in ›. */
.notebook button{transition:none}
.notebook .journal-filters button{min-height:44px;padding:5px 8px;border:1px solid #9b7a4c88;border-radius:3px;font-style:normal;background:#c5a56c18}
.notebook .journal-filters button[aria-pressed="true"]{border-color:#9b2a1e;background:#c5a56c40;color:#2c1a0c;font-weight:700}
.notebook .journal-line{min-height:44px;border-left:3px solid transparent}
.notebook .journal-line[aria-pressed="true"]{border-left-color:#9b2a1e}
.journal-line-title{flex:1;min-width:0}
.journal-new-label{flex:none;font-size:10px;color:#8c291e}
.journal-arrow{flex:none;color:#8c291e}
.journal-copy h3{color:#732b1e}
.notebook .bookmark[aria-pressed="true"],.notebook .bookmark:hover:not(:disabled){filter:none}
.bookmark[aria-pressed="true"]>span{text-decoration:underline;text-underline-offset:4px}

/* A new note brings its ink up on the right page (the opening of the notebook is in taccuino.css). */
.journal-page-enter{animation:journal-ink 180ms ease-out var(--page-at,0ms) both}
@keyframes journal-ink{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}

/* Atlas: the framed panel on paper; tabs for the parts of the journey; framed pictures with the name on a cartouche
   (the frame's own band is too thin to read); Cheeseman's on its drawn plan with brass pins. */
.modal.panel-map{width:min(1120px,96vw);max-height:none;color:#3a2414}
.modal.panel-map::before{background:url('../assets/ui/kit/ui-v2-carta.webp') center/100% 100% no-repeat,#ecdcb8}
.modal h2.atlas-title{margin:0 0 20px;text-align:center;font:600 calc(clamp(26px,2.4vw,36px) * var(--kit-scale,1))/1.1 var(--kit-display);color:#2c1a0c}
.atlas-title span{font-size:.7em;color:#8a5a2a}
.atlas-tabs{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.atlas-tab{display:inline-flex;align-items:center;gap:8px;padding:6px 16px;border:1px solid #9b7a4c88;border-radius:2px;background:#f4e8cc99;color:#4a2e16;font:600 calc(16px * var(--kit-scale,1))/1.2 var(--kit-display)}
.atlas-tab .kit-icon{width:24px;height:24px;filter:drop-shadow(0 1px 1px #0006)}
.atlas-tab[aria-pressed="true"]{background:linear-gradient(#123a2f,#04160f);border-color:var(--kit-gold);color:var(--kit-ivory)}
.atlas-tab:hover:not(:disabled){border-color:#9b2a1e;background:#f4e8cc}
.atlas-tab[aria-pressed="true"]:hover:not(:disabled){background:linear-gradient(#174a3c,#072019)}
.atlas-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:22px;row-gap:34px;padding:8px 8px 20px}
.place-card{position:relative;isolation:isolate;display:block;width:min(300px,42%);aspect-ratio:640/448;padding:0;border:0;border-radius:0;background:none;color:var(--kit-ivory)}
.place-card img{position:absolute;left:4%;right:4%;top:7.6%;height:81.9%;width:92%;object-fit:cover;z-index:-1}
.place-card::after{content:'';position:absolute;inset:0;background:url('../assets/ui/kit/ui-v2-cornice-luogo.webp') center/100% 100% no-repeat;pointer-events:none}
.place-card .place-name{position:absolute;left:50%;bottom:-3%;transform:translateX(-50%);max-width:92%;display:grid;place-items:center;z-index:1;padding:5px 14px;border-style:solid;border-width:6px 18px;border-image:url('../assets/ui/kit/ui-v2-targhetta-nome.webp') 16 48 fill / 6px 18px / 0 stretch;font:600 calc(clamp(13px,1.1vw,17px) * var(--kit-scale,1))/1 var(--kit-display);white-space:nowrap;text-overflow:ellipsis;text-shadow:0 1px 2px #000}
.place-card small{position:absolute;left:8%;right:8%;top:62%;z-index:1;padding:4px 8px;background:#00100cd8;border:1px solid #c5a56c88;font:italic calc(12px * var(--kit-scale,1))/1.3 var(--kit-text);text-align:center}
.place-card:hover:not(:disabled){filter:brightness(1.12) drop-shadow(0 0 8px #e9bc6c88);background:none;border:0}
.place-card.locked img{filter:grayscale(.75) brightness(.55)}
.place-lock{position:absolute;left:50%;top:34%;width:48px;height:48px;transform:translate(-50%,-50%);z-index:1;background:url('../assets/ui/kit/ui-v2-lucchetto.webp') center/contain no-repeat;filter:drop-shadow(0 2px 3px #000a)}
.place-pin,.plan-here{position:absolute;width:40px;height:40px;z-index:2;background:url('../assets/ui/kit/ui-v2-spillo.webp') center/contain no-repeat;filter:drop-shadow(0 3px 3px #0009)}
.place-pin{right:6%;top:3%}
.plan{position:relative;margin:0 auto;width:100%;max-width:min(960px,calc(min(60dvh,560px) * 1.5))}
.plan-art{width:100%;height:auto;display:block}
.plan-pin{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:2px;padding:0;border:0;border-radius:0;background:none;color:var(--kit-ivory)}
.plan-pin.locked{cursor:help}
.plan-pin .pin-mark{display:grid;place-items:center;width:clamp(32px,3vw,42px);height:clamp(32px,3vw,42px);border-radius:50%;background:url('../assets/ui/kit/ui-v2-punto.webp') center/100% 100% no-repeat;box-shadow:0 2px 6px #0009}
.plan-pin .pin-mark .kit-icon{width:62%;height:62%}
.plan-pin.current .pin-mark{background:none;box-shadow:none}
.plan-pin .plan-here{position:static;width:42px;height:42px}
.plan-pin .pin-name{padding:4px 12px;border-style:solid;border-width:6px 18px;border-image:url('../assets/ui/kit/ui-v2-targhetta-nome.webp') 16 48 fill / 6px 18px / 0 stretch;white-space:nowrap;font:600 calc(clamp(12px,1vw,15px) * var(--kit-scale,1))/1.1 var(--kit-display);text-shadow:0 1px 2px #000}
.plan-pin.locked .pin-mark{filter:grayscale(.6) brightness(.8)}
.plan-pin:hover:not(:disabled) .pin-mark{filter:brightness(1.2) drop-shadow(0 0 8px #f3d38b);border:0}
.plan-pin:hover:not(:disabled){background:none;border:0}
.plan-pin:focus-visible,.place-card:focus-visible,.atlas-tab:focus-visible{outline:2px solid #9b2a1e;outline-offset:2px}
.plan-note{margin:10px auto 0;max-width:640px;padding:8px 14px;border-left:3px solid #9b2a1e;background:#f4e8cccc;color:#3a2414;font:italic calc(14px * var(--kit-scale,1))/1.4 var(--kit-text)}
.atlas-page>.plan-note:first-child{margin:0 auto 10px}

/* The bag: the painted open bag at its own proportions (its buckles must not stretch), sized to the screen too. */
.modal.panel-inventory{width:min(1000px,96vw,calc((100dvh - 70px) * 1.6));max-height:none;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;color:var(--kit-ivory)}
.modal.panel-inventory>.close-modal{top:2%;right:1%}
.modal h2.bag-title{margin:0 0 20px;text-align:center;font:600 calc(clamp(26px,2.4vw,36px) * var(--kit-scale,1))/1.1 var(--kit-display);color:var(--kit-gold);text-shadow:0 2px 4px #000}
.bag{position:relative;isolation:isolate;aspect-ratio:1024/640;width:100%;background:url('../assets/ui/kit/ui-v2-borsa-aperta.webp') center/100% 100% no-repeat;filter:drop-shadow(0 20px 40px #000c)}
.bag::before{content:'';position:absolute;left:7%;right:7%;top:18%;bottom:26%;z-index:-1;border-radius:4%;background:radial-gradient(ellipse at 50% 40%,#0d3a2a,#03140d 80%)}
.bag-inside{position:absolute;left:8%;right:8%;top:19.5%;bottom:25.5%;display:flex;align-items:center;justify-content:center;gap:4%;overflow:auto}
.bag-item{flex:1;max-width:46%;display:flex;flex-direction:column;align-items:center;text-align:center;font:calc(14px * var(--kit-scale,1))/1.4 var(--kit-text)}
.bag-picture{width:min(170px,70%);height:auto;filter:drop-shadow(0 6px 10px #000c);transform:rotate(-2deg)}
.bag-useful .bag-picture{transform:rotate(2deg)}
.bag-item h3{margin:8px 0 2px;font:600 calc(clamp(18px,1.6vw,24px) * var(--kit-scale,1))/1.1 var(--kit-display);color:var(--kit-gold)}
.bag-item p{margin:0 0 8px;font-size:calc(13px * var(--kit-scale,1))}
.bag-actions{display:flex;flex-direction:column;align-items:center;gap:6px}
.bag-actions .kit-plate{white-space:nowrap;min-height:40px}
.bag-select{border:0;background:none;color:#cdbd97;font:italic calc(13px * var(--kit-scale,1))/1.2 var(--kit-text);text-decoration:underline;text-underline-offset:3px;padding:4px}
.bag-empty{font-style:italic;text-align:center}

/* The table's closing panels (the case solved, the note delivered) in the medium shaped frame on marble; the table itself is in board.css. */
#app.immersive .board-panel{--frame-w:48px;position:relative;isolation:isolate;background:none;border:0;border-radius:0;box-shadow:none;padding:calc(var(--frame-w) * .72) calc(var(--frame-w) * .78);color:var(--kit-ivory);font-family:var(--kit-text)}
#app.immersive .board-panel::before{content:'';position:absolute;inset:calc(var(--frame-w) * .55);z-index:-1;border-radius:calc(var(--frame-w) * .21);background:linear-gradient(#00100cd0,#00100cd0),url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green);box-shadow:0 14px 40px #000c}
#app.immersive .board-panel::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-style:solid;border-width:var(--frame-w);border-image:url('../assets/ui/kit/ui-v2-cornice-media.webp') 112 / var(--frame-w) / 0 stretch}
#app.immersive .board-panel{overflow:visible;display:flex;flex-direction:column;min-height:0}
#app.immersive .board-scroll{min-height:0;max-height:100%;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--kit-bronze) transparent}

#app.immersive .board-panel h2{font-family:var(--kit-display);font-weight:600;color:var(--kit-gold)}

#app.immersive .board-finished .primary{position:relative;display:inline-flex;align-items:center;min-height:50px;padding:0 1.6em 0 2.6em;border:0;border-style:solid;border-width:0 26px;border-image:url('../assets/ui/kit/ui-v2-pulsante-verde.webp') 0 96 fill / 0 26px / 0 stretch;background:none;color:var(--kit-ivory);font:600 calc(clamp(15px,1.15cqw,19px) * var(--kit-scale,1))/1.1 var(--kit-display);text-shadow:0 1px 2px #000}

#app.immersive .board-finished .primary:hover:not(:disabled){filter:brightness(1.15) drop-shadow(0 0 6px #e9bc6c88);border-color:transparent;background:none}

/* The other panels (settings, how to play, credits, new game, topics of a talk): framed, on darkened marble. */
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics){width:min(820px,96vw);max-height:none;color:var(--kit-ivory);font-family:var(--kit-text)}
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics)::before{background:linear-gradient(#00100cc8,#00100cc8),url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green)}
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) h2{font:600 calc(clamp(26px,2.4vw,36px) * var(--kit-scale,1))/1.1 var(--kit-display);color:var(--kit-gold)}
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) h3{font:600 calc(clamp(19px,1.6vw,24px) * var(--kit-scale,1))/1.2 var(--kit-display);color:var(--kit-gold-mid)}
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) .eyebrow{font:italic calc(13px * var(--kit-scale,1))/1.3 var(--kit-text);color:#cdbd97;text-transform:none;letter-spacing:.04em}
.modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) p{font-family:var(--kit-text);color:#e9dfc4}
.panel-topics .topic-list button{border:1px solid #c5a56c77;border-radius:2px;background:linear-gradient(#0c2a22,#04160f);color:var(--kit-ivory);font-family:var(--kit-text)}
.panel-topics .topic-list button:hover:not(:disabled){border-color:var(--kit-gold);background:linear-gradient(#123a2f,#072019)}
.modal:is(.panel-settings,.panel-new,.panel-home) .menu-actions button:not(.primary){min-height:44px;padding:0 1.6em;border:0;border-style:solid;border-width:0 22px;border-image:url('../assets/ui/kit/ui-v2-pulsante-legno.webp') 0 80 fill / 0 22px / 0 stretch;border-radius:0;background:none;color:var(--kit-ivory);font:600 calc(15px * var(--kit-scale,1))/1.1 var(--kit-display)}
.modal:is(.panel-new,.panel-home) .menu-actions .primary{border:0;border-style:solid;border-width:0 26px;border-image:url('../assets/ui/kit/ui-v2-pulsante-verde.webp') 0 96 fill / 0 26px / 0 stretch;border-radius:2px;background:none;color:var(--kit-ivory);font:600 calc(17px * var(--kit-scale,1))/1.1 var(--kit-display)}
.modal:is(.panel-settings,.panel-new,.panel-home) .menu-actions button:hover:not(:disabled){filter:brightness(1.15);border-color:transparent;background:none}
/* Settings: brass lever switches and brass volume rails (the real inputs, dressed). */
.panel-settings .settings label{font-family:var(--kit-text);color:var(--kit-ivory)}
.panel-settings input[type="checkbox"]{appearance:none;position:relative;flex:none;width:56px;height:28px;margin:0 12px 0 0;vertical-align:middle;background:url('../assets/ui/kit/ui-v2-interruttore-base.webp') center/100% 100% no-repeat;cursor:pointer;filter:grayscale(.5) brightness(.85);transition:filter .15s}
.panel-settings input[type="checkbox"]::before{content:'';position:absolute;top:50%;left:6px;width:20px;height:20px;transform:translateY(-50%);background:url('../assets/ui/kit/ui-v2-interruttore-pomolo.webp') center/contain no-repeat;transition:left .15s}
.panel-settings input[type="checkbox"]:checked{filter:none}
.panel-settings input[type="checkbox"]:checked::before{left:30px}
.panel-settings input[type="range"]{appearance:none;height:24px;background:url('../assets/ui/kit/ui-v2-guida-cursore.webp') center/100% 12px no-repeat}
.panel-settings input[type="range"]::-webkit-slider-thumb{appearance:none;width:22px;height:28px;border:0;background:url('../assets/ui/kit/ui-v2-manopola.webp') center/contain no-repeat;cursor:pointer}
.panel-settings input[type="range"]::-moz-range-thumb{width:22px;height:28px;border:0;background:url('../assets/ui/kit/ui-v2-manopola.webp') center/contain no-repeat}
.panel-settings input:focus-visible{outline:2px solid var(--kit-ivory);outline-offset:3px}
.panel-settings output{color:var(--kit-gold)}

/* Search accessories (completion plaque, search menu, energy note, object detail): the gilded scroll and the medium
   shaped frame of the kit. The painting and its alignment are untouched. */
.inn-search .inn-complete{--k:.7;border:0;border-style:solid;border-width:calc(50px * var(--k)) calc(128px * var(--k)) calc(49px * var(--k));border-image:url('../assets/ui/kit/ui-v2-cartiglio-avviso.webp') 50 128 49 fill / calc(50px * var(--k)) calc(128px * var(--k)) calc(49px * var(--k)) / 0 stretch;border-radius:0;background:none;box-shadow:none;padding:.35em 8px .3em;filter:drop-shadow(0 8px 16px #000b);font-family:var(--kit-text)}
.inn-search .inn-complete:hover:not(:disabled),.inn-search .inn-complete:focus-visible{background:none;filter:brightness(1.12) drop-shadow(0 0 10px #e9bc6c99)}
.inn-complete-title{font:600 1.45em/1.1 var(--kit-display)}
.inn-complete-go{border-radius:0;background:none;box-shadow:none;border:0;border-style:solid;border-width:0 18px;border-image:url('../assets/ui/kit/ui-v2-pulsante-verde.webp') 0 96 fill / 0 18px / 0 stretch;color:var(--kit-ivory);font:600 1.05em/1 var(--kit-display);padding:.55em .8em}
.inn-menu,.inn-energy-info,.inn-object-detail{--frame-w:40px;isolation:isolate;padding:calc(var(--frame-w) * .7);background:none;border:0;border-radius:0;box-shadow:none;font-family:var(--kit-text)}
.inn-menu::before,.inn-energy-info::before,.inn-object-detail::before{content:'';position:absolute;inset:calc(var(--frame-w) * .55);z-index:-1;border-radius:calc(var(--frame-w) * .21);background:linear-gradient(#00100cc8,#00100cc8),url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green);box-shadow:0 10px 30px #000c}
.inn-menu::after,.inn-energy-info::after,.inn-object-detail::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-style:solid;border-width:var(--frame-w);border-image:url('../assets/ui/kit/ui-v2-cornice-media.webp') 112 / var(--frame-w) / 0 stretch}
.inn-menu h3,.inn-energy-info h3,.inn-object-detail h3{font:600 1.35em/1.15 var(--kit-display);color:var(--kit-gold)}
.inn-search .inn-text-button{border:0;border-style:solid;border-width:0 18px;border-image:url('../assets/ui/kit/ui-v2-pulsante-legno.webp') 0 80 fill / 0 18px / 0 stretch;border-radius:0;background:none;color:var(--kit-ivory);font:600 15px/1.1 var(--kit-display);padding:8px 10px}

/* The reflection puzzle: the large painted frame of the close-ups, gold heading, and the two choices as kit labels. */
.modal.interaction-modal:has(.reflection-puzzle){--frame-w:66px;width:min(900px,96vw);max-height:none;color:var(--kit-ivory);font-family:var(--kit-text)}
.modal.interaction-modal:has(.reflection-puzzle)>:is(.eyebrow,h2,p){margin-left:0;margin-right:0}
.modal.interaction-modal:has(.reflection-puzzle)>.eyebrow{margin-top:0;font:italic calc(13px * var(--kit-scale,1))/1.3 var(--kit-text);color:#cdbd97;letter-spacing:.06em}
.modal.interaction-modal:has(.reflection-puzzle) h2{margin-bottom:6px;font:600 calc(clamp(22px,2vw,30px) * var(--kit-scale,1))/1.15 var(--kit-display);color:var(--kit-gold)}
.modal.interaction-modal:has(.reflection-puzzle)>p{margin-bottom:12px;color:var(--kit-ivory)}
/* The picture is sized by the height too (frame and heading take about 240px), so the panel fits a 1280×600 laptop as well. */
.modal.interaction-modal .reflection-puzzle{width:min(100%,calc((100dvh - 260px) * 16 / 9));margin:0 auto;border:1px solid #c5a56c88;box-shadow:0 4px 16px #000a}
.modal.interaction-modal .reflection-choice span{white-space:nowrap;border:1px solid var(--kit-gold);background:linear-gradient(#174a3cf0,#072019f0);color:var(--kit-ivory);font-family:var(--kit-text);box-shadow:0 3px 10px #000a}
/* The garden's label stays inside the picture, whose frame clips anything past its edge. */
.modal.interaction-modal .reflection-choice.garden span{transform:none}

/* The spot «Mostra dove» points at: a breathing halo like the one on a hinted search object, and its name, so it stands out from its neighbours. */
#app.immersive .hotspot.revealed{z-index:3}
#app.immersive .hotspot.revealed::after{content:'';position:absolute;left:50%;top:50%;width:62px;height:62px;margin:-31px 0 0 -31px;border-radius:50%;border:2px solid #f8d58a;box-shadow:0 0 26px 6px #f8d58aaa;pointer-events:none;animation:hunt-hint 2.4s ease-in-out infinite}
#app.immersive .hotspot.revealed .spot-label{opacity:1}
@media(prefers-reduced-motion:reduce){#app.immersive .hotspot.revealed::after{animation:none}}

/* At the table Watson's note stands on the right, under the medallions: on the left it covered the column of tabs and the plaque. */
#app.immersive .board-stage .hint-note{position:absolute;top:calc(clamp(44px,4.1cqw,66px) + 24px);right:clamp(10px,1.2cqw,22px);left:auto;z-index:6;width:min(440px,44cqw);margin:0}

/* Searches are red: their plate in the tray, their medallion on the painting (the eye on a red ground) and their entries in «Attività»,
   so a search never looks like any other activity. The red pieces are recoloured twins of the green ones (tools/kit-rosso.mjs). */
.kit-plate-red{border-image-source:url('../assets/ui/kit/ui-v2-pulsante-rosso.webp');--plate-cut:96}
#app.immersive .hotspot.hunt-spot .spot-ring{background-image:url('../assets/ui/kit/ui-v2-punto-rosso.webp');width:clamp(36px,3.1cqw,50px);height:clamp(36px,3.1cqw,50px)}
#app.immersive .hotspot.hunt-spot:not(.observed):not(.locked)::before{content:'';position:absolute;left:50%;top:50%;width:clamp(36px,3.1cqw,50px);aspect-ratio:1;translate:-50% -50%;border-radius:50%;box-shadow:0 0 0 2px #e0444f99,0 0 18px 4px #c0263280;pointer-events:none;animation:hunt-call 2.2s ease-out var(--call-delay,0ms) infinite}
@keyframes hunt-call{0%{scale:1;opacity:.9}70%,100%{scale:1.7;opacity:0}}
.activity-drawer .activity-hunt:not(.examined){border-color:#b4303a88;background:linear-gradient(90deg,#8e1d2655,#8e1d2610 70%)}
.activity-drawer section:has(.activity-hunt) h3{color:#f08a8f}

/* Not yet possible: grey until it is. A tap says what comes first (from the model). Future readings carry a padlock. */
#app.immersive .hotspot.locked .spot-ring,#app.immersive .hotspot.locked .actor-label,#app.immersive .hotspot.locked .person-medallion{filter:grayscale(1) brightness(.72);opacity:.8;animation:none}
#app.immersive .hotspot.locked::before{display:none}
#app.immersive .hotspot.future .spot-ring{width:clamp(26px,2.2cqw,36px);height:clamp(26px,2.2cqw,36px);opacity:.7}
.activity-drawer .activity.locked{filter:grayscale(1);opacity:.62}
.activity-drawer .activity-later h3{color:#a9a294}
#app.immersive .kit-plate.locked{filter:grayscale(1) brightness(.78);opacity:.85}
/* Just became possible: one golden flash, so the change is noticed (the timing comes from the view, so a repaint does not replay it). */
#app.immersive .hotspot.just-unlocked .spot-ring,#app.immersive .hotspot.just-unlocked .actor-label{animation:spot-unlock 1.4s ease-out var(--unlock-delay,0ms) both}
@keyframes spot-unlock{0%{transform:scale(.6);filter:brightness(2) drop-shadow(0 0 16px #f8d58a)}40%{transform:scale(1.3);filter:brightness(1.4) drop-shadow(0 0 14px #f8d58a)}100%{transform:none;filter:none}}

/* Ways out: shown once the place is done (see exitArrows). A brass medallion with the arrow turned toward where it leads,
   moving that way; the arrow on the way to the next step is larger, glows and always shows its name. */
#app.immersive .exit-spot{--bob:6px}
#app.immersive .exit-spot .exit-ring{display:grid;place-items:center;width:clamp(34px,3cqw,48px);height:clamp(34px,3cqw,48px);border-radius:50%;background:url('../assets/ui/kit/ui-v2-punto.webp') center/100% 100% no-repeat;box-shadow:0 2px 8px #000c;animation:exit-bob 1.6s ease-in-out var(--bob-delay,0ms) infinite}
#app.immersive .exit-spot .exit-ring .kit-icon{width:66%;height:66%;rotate:var(--turn,90deg)}
#app.immersive .exit-left{--turn:0deg;--dx:-1;--dy:0}
#app.immersive .exit-right{--turn:180deg;--dx:1;--dy:0}
#app.immersive .exit-in,#app.immersive .exit-up{--turn:90deg;--dx:0;--dy:-1}
#app.immersive .exit-down{--turn:-90deg;--dx:0;--dy:1}
@keyframes exit-bob{0%,100%{translate:0 0}50%{translate:calc(var(--dx) * var(--bob)) calc(var(--dy) * var(--bob))}}
#app.immersive .exit-spot.exit-next{--bob:10px;z-index:3}
#app.immersive .exit-spot.exit-next .exit-ring{width:clamp(42px,3.7cqw,58px);height:clamp(42px,3.7cqw,58px);box-shadow:0 0 0 2px #f3d38b,0 0 22px 6px #f3c56a99}
#app.immersive .exit-spot.exit-next .spot-label{opacity:1}
#app.immersive .exit-spot.edge-left .spot-label{left:0;transform:none}
#app.immersive .exit-spot.edge-right .spot-label{left:auto;right:0;transform:none}
#app.immersive .exit-spot.locked .exit-ring{filter:grayscale(1) brightness(.7);opacity:.75;animation:none}
#app.immersive .exit-spot:is(:hover,:focus-visible) .exit-ring{filter:brightness(1.2) drop-shadow(0 0 10px #f3d38bcc)}

/* The × of the panels is gone: they close with a tap outside. It stays for the keyboard and screen readers, seen only when focused from the keyboard. */
.modal>.close-modal.sr-close:not(:focus-visible),.sr-close:not(:focus-visible){position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;padding:0!important;overflow:hidden;clip-path:inset(50%);border:0!important;opacity:0}
.outside-hint{opacity:.45;position:fixed;left:50%;bottom:max(6px,env(safe-area-inset-bottom));translate:-50% 0;margin:0;padding:2px 10px;font:italic calc(12px * var(--kit-scale,1))/1.3 var(--kit-text);color:#e9dcc0b0;text-shadow:0 1px 2px #000;pointer-events:none;white-space:nowrap}
.outside-hint.hint-enter{animation:outside-hint 4s ease-out var(--enter-at,0ms) both}
@keyframes outside-hint{0%{opacity:0}12%,70%{opacity:1}100%{opacity:.45}}
.toast{cursor:pointer}

/* Small touches of life: panels open with a short rise, the activities drawer slides in, a new place brings its points up
   one after another, and pressed plates and medallions give way under the finger. */
.modal.modal-enter{animation:modal-enter .26s cubic-bezier(.2,.8,.3,1) var(--enter-at,0ms) both}
@keyframes modal-enter{from{opacity:0;transform:translateY(10px) scale(.97)}}
#app.immersive .activity-drawer.drawer-enter{animation:drawer-enter .3s cubic-bezier(.2,.8,.3,1) var(--enter-at,0ms) both}
@keyframes drawer-enter{from{opacity:0;transform:translateX(-18px)}}
#app.immersive .stage.scene-enter .scene-layer>.hotspot{animation:spot-rise .45s cubic-bezier(.2,.8,.3,1) calc(var(--enter-delay,0ms) + 700ms + var(--i,0) * 70ms) both}
@keyframes spot-rise{from{opacity:0;translate:0 10px}}
#app.immersive :is(.kit-plate,.kit-medallion):active:not(:disabled){transform:scale(.95);transition:transform .08s}
.toast.toast-enter{animation:toast-in .3s cubic-bezier(.2,.8,.3,1) var(--enter-at,0ms) both}
@keyframes toast-in{from{opacity:0;translate:0 -8px}}
@media(prefers-reduced-motion:reduce){
  #app.immersive .exit-spot .exit-ring,#app.immersive .hotspot.hunt-spot::before,#app.immersive .hotspot.just-unlocked .spot-ring,#app.immersive .hotspot.just-unlocked .actor-label,.modal.modal-enter,#app.immersive .activity-drawer.drawer-enter,#app.immersive .stage.scene-enter .scene-layer>.hotspot,.toast.toast-enter,.outside-hint{animation:none}
}

/* Small screens and reduced motion: kept last, so they outweigh the general rules above. */
@media(prefers-reduced-motion:reduce){#app.immersive .hotspot .spot-ring{animation:none}}
@media (max-width:1000px),(max-height:560px){
  #app.immersive .hud-bottom.kit-tray{--tray-k:.24;gap:6px}
  #app.immersive .kit-medallion{width:38px;height:38px}
  /* Drawn at 38px, touched at 44px: an invisible margin around each medallion, as around the pins of the plan. */
  #app.immersive .kit-medallion::before{content:'';position:absolute;inset:-3px;border-radius:50%}
  #app.immersive .kit-tray .kit-lens{width:44px;height:44px}
  #app.immersive .tray-tools{gap:4px}
  #app.immersive .kit-tray .hud-question{font-size:calc(12px * var(--kit-scale))}
  #app.immersive .kit-tray .hud-question .tiny-label{display:none}
  #app.immersive .kit-tray .kit-plate{min-height:36px;padding:0 .8em;font-size:calc(13px * var(--kit-scale))}
  #app.immersive .kit-location{--k:.32}
  #app.immersive .kit-location h1{font-size:calc(18px * var(--kit-scale))}
  #app.immersive .kit-location .eyebrow,#app.immersive .kit-location .hud-sub{display:none}
  #app.immersive .activity-drawer{bottom:72px;width:min(46vw,360px);min-width:0;--frame-w:34px}
  #app.immersive .activity-drawer .kit-panel-body{max-height:calc(100dvh - 190px)}
  #app.immersive .vn-band{--frame-w:30px;padding-top:calc(var(--frame-w) * 1.05)}
  #app.immersive .hint-note{max-width:min(600px,72cqw);font-size:calc(12px * var(--kit-scale));--k:.5}
  #app.immersive .hint-note p{margin-bottom:4px}
  #app.immersive .hint-actions .kit-plate{white-space:nowrap;min-height:30px;font-size:calc(13px * var(--kit-scale))}
  .plan-pin .pin-name{display:none}
  .plan-pin:is(:hover,:focus-visible,.current,[aria-pressed="true"]) .pin-name{display:block}
}
@media (max-width:900px){
  #app.immersive .kit-tray .hud-question{display:none}
  .notebook{display:block;grid-template-columns:1fr;column-gap:0;height:auto;max-height:calc(100dvh - 90px);overflow:auto;background:linear-gradient(#0d2419,#16352a)}
  .notebook-page{overflow:visible}
  .page-right{margin-top:14px}
  .bookmark{font-size:calc(13px * var(--kit-scale,1))}
  .modal.panel-map{--frame-w:40px}
  .place-card{width:46%}
  .plan-pin .pin-name{font-size:11px;padding:2px 6px}
  .bag-inside{flex-direction:column;justify-content:flex-start}
  .bag-item{max-width:100%}
  .bag-picture{width:120px}
}
@media (max-height:560px){
  .modal.panel-pause{--frame-w:46px;width:min(620px,94vw)}
  .pause-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .pause-list .kit-plate{min-height:38px;white-space:nowrap;padding-left:1em;font-size:calc(15px * var(--kit-scale,1))}
  .modal.panel-pause .pause-title::before{width:140px}
  .modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics,.panel-map){--frame-w:42px}
  .modal.interaction-modal:has(.dialogue-layout),.modal.interaction-modal:has(.reflection-puzzle){--frame-w:32px}
  /* Close-ups on a landscape phone: the whole panel fits the screen, the picture shrinks to fit and the button stays in view. */
  .modal-backdrop:has(.dialogue-layout){padding:6px}
  .modal.interaction-modal:has(.dialogue-layout) .dialogue-layout{min-height:0;max-height:calc(100dvh - var(--frame-w) * 2 - 12px);grid-template-columns:42% 58%;scrollbar-width:thin;scrollbar-color:var(--kit-bronze) transparent}
  .modal.interaction-modal:has(.dialogue-layout) .dialogue-layout::before{width:110px}
  .modal.interaction-modal .detail-image{position:sticky;top:0;align-self:start}
  .modal.interaction-modal .detail-image img{max-height:calc(100dvh - var(--frame-w) * 2 - 12px)}
  .modal.interaction-modal .dialogue-copy{padding:14px 16px 0}
  .modal.interaction-modal .dialogue-copy h2{font-size:calc(22px * var(--kit-scale));margin-bottom:6px}
  .modal.interaction-modal .dialogue-text{line-height:1.45;font-size:calc(var(--reading-size) - 1px)}
  .modal.interaction-modal .reading-complete{margin:8px 0 0;font-size:14px}
  .modal.interaction-modal .dialogue-copy::after{display:none}
  .modal.interaction-modal .dialogue-footer{position:sticky;bottom:0;z-index:3;margin-top:auto;padding:8px 0 10px;background:linear-gradient(#00100c00,#00100cf2 30%)}
  .modal.interaction-modal .dialogue-footer>span,.modal.interaction-modal .dialogue-footer .primary{white-space:nowrap}
  /* The completion note moves into the footer, beside the button, so the button never covers it. */
  .modal.interaction-modal .dialogue-copy .reading-complete{display:none}
  .modal.interaction-modal .dialogue-footer:has(.footer-done)>span:first-child{display:none}
  .modal.interaction-modal .footer-done{display:inline;color:#d1bb86;font-size:14px}
  /* Text below the fold (the scrollbar is thin and bronze): a «scorri» mark over the footer, gone once the end is in view. */
  .modal.interaction-modal .more-below .dialogue-footer::before{content:'▾ scorri';position:absolute;left:50%;top:-12px;transform:translateX(-50%);padding:1px 10px;border-radius:9px;background:#00100ce6;color:#e3cf9c;font:italic 12px/1.4 var(--kit-text);pointer-events:none}
}
/* Bookmarks inside the notebook on small screens, so they are never above the top of the screen. */
@media (max-width:900px),(max-height:560px){
  .modal.panel-journal{margin-top:0}
  .bookmarks{position:static;transform:none;flex-wrap:wrap;gap:6px;margin:0 0 8px}
  .bookmark{min-height:44px;padding-top:12px;width:auto;min-width:78px}
}
/* Evidence table and closing letter on a landscape phone: the tools stand in a rail on the left, so the board gets the
   whole height of the screen instead of what the top bar and the tray leave of it. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  #app.immersive .board-stage .hud{display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);column-gap:4px}
  #app.immersive .board-stage .hud-top{grid-column:1;grid-row:1;padding:6px 0 0 4px}
  #app.immersive .board-stage .hud-location{display:none}
  #app.immersive .board-stage .hud-tools{flex-direction:column;flex-wrap:nowrap;gap:4px}
  #app.immersive .board-stage .hud-bottom.kit-tray{grid-column:1;grid-row:2;align-self:start;flex-direction:column;margin:4px 0 0 4px;padding:0;border:0;background:none;box-shadow:none}
  #app.immersive .board-stage .kit-tray::before,#app.immersive .board-stage .kit-tray::after{display:none}
  #app.immersive .board-stage .tray-tools{flex-direction:column;gap:4px}
  #app.immersive .board-stage .kit-tray .kit-lens{width:38px;height:38px}
  #app.immersive .board-stage .kit-tray .hud-question,#app.immersive .board-stage .kit-tray .hud-controls:empty{display:none}
  #app.immersive .board-stage .hud-body{grid-column:2;grid-row:1 / span 2;padding:4px 8px 4px 0}
  /* Watson's note sits under the tabs, never over them: they are the way around the table. */
  #app.immersive .board-stage :is(.hint-note,.blocked-action){position:absolute;top:60px;left:56px;right:8px;z-index:6;width:auto;margin:0}
  #app.immersive .board-panel{--frame-w:30px}
}
/* The atlas on a landscape phone: title and tabs in a column beside the page, so the plan uses the full height and is never cut. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .modal.panel-map{--frame-w:34px}
  .modal.panel-map .panel-body{display:grid;grid-template-columns:minmax(0,150px) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);column-gap:12px;align-items:start}
  .modal.panel-map h2.atlas-title{grid-column:1;margin:0 0 8px;font-size:calc(20px * var(--kit-scale,1));text-align:left}
  .modal.panel-map .atlas-tabs{grid-column:1;flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:6px;margin:0}
  .modal.panel-map .atlas-tab{min-height:40px;padding:4px 10px;font-size:calc(14px * var(--kit-scale,1))}
  .modal.panel-map .atlas-page{position:relative;grid-column:2;grid-row:1 / span 2;min-width:0}
  .modal.panel-map .plan{max-width:min(100%,calc((100dvh - var(--frame-w) * 2 - 24px) * 1.5))}
  .modal.panel-map .atlas-cards{gap:10px;row-gap:12px;padding:0 0 8px}
  /* A pin keeps a 44px touch area; the name of the room you are in never covers the pins below it. */
  .plan-pin::before{content:'';position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}
  .plan-pin.current{pointer-events:none;z-index:0}
  .plan-pin:not(.current){z-index:1}
  .plan-pin.current .pin-name{opacity:.92}
  /* What a closed room lacks is written over the foot of the plan, not under it, so the atlas never grows past the screen. */
  .modal.panel-map .plan~.plan-note{position:absolute;left:6px;right:6px;bottom:6px;margin:0;z-index:2;box-shadow:0 2px 8px #3a241466}
  .plan-pin.locked[aria-pressed="true"] .pin-name{display:none}
}
/* The notebook on a landscape phone stays open on two pages, each scrolling on its own: a tapped line shows its page beside
   the list, not off screen below it. The bookmarks stand in one row across the top of the cover. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .modal.panel-journal{width:min(100%,900px)}
  .modal.panel-journal>.close-modal{top:2px;right:2px;z-index:4}
  .notebook{--cover:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);column-gap:22px;height:calc(100dvh - 16px);max-height:none;overflow:hidden;background-size:22px 100%}
  .notebook .bookmarks{grid-column:1 / -1;flex-wrap:nowrap;gap:6px;margin:0 52px 6px 0}
  .notebook .bookmark{flex:1 1 0;flex-direction:row;gap:6px;min-width:0;min-height:40px;padding:8px 6px 6px}
  .notebook .bookmark[aria-pressed="true"]{transform:none}
  .notebook .bookmark small{font-size:12px}
  .notebook-page{overflow:auto;padding:12px 14px;font-size:calc(14px * var(--kit-scale,1))}
  .notebook .page-right{margin-top:0}
  .notebook .journal-heading{display:none}
  .journal-objective{margin-bottom:6px;font-size:calc(14px * var(--kit-scale,1));line-height:1.35}
  .journal-filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:0 12px;margin-bottom:4px;padding-right:24px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
  .journal-filters button{white-space:nowrap;min-height:32px;font-size:calc(12.5px * var(--kit-scale,1))}
  .journal-line{min-height:40px;font-size:calc(14px * var(--kit-scale,1))}
  .journal-photo{width:min(70%,260px);margin-bottom:10px}
}
/* Framed panels on a landscape phone: a thinner frame, smaller headings, and the topics of a conversation in two columns. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics){--frame-w:32px;width:min(860px,98vw)}
  .modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) h2{font-size:calc(21px * var(--kit-scale,1));margin-bottom:8px}
  .modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics) .eyebrow{margin-bottom:2px}
  .panel-topics .topic-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .panel-topics .topic-list button{min-height:48px;padding:6px 10px;gap:8px;line-height:1.3}
  .panel-topics .topic-list small{margin-top:2px}
  .panel-new p,.panel-home p{margin:0 0 8px}
  :is(.panel-new,.panel-home) .menu-actions{gap:8px;margin:0 0 4px}
  .panel-new .menu-note{margin:0}
}
/* Notices on a landscape phone: a smaller scroll; during a conversation it keeps to the very top, above the faces. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .toast{--k:.4;font-size:calc(13px * var(--kit-scale,1));line-height:1.35;max-width:min(520px,70vw)}
  #app.immersive:has(.vn) .toast{top:4px}
}
/* The reflection puzzle on a landscape phone: short heading, and a picture sized by the height left, so both choices are on screen. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .modal.interaction-modal:has(.reflection-puzzle){--frame-w:30px;max-height:calc(100dvh - 12px)}
  .modal.interaction-modal:has(.reflection-puzzle)>.eyebrow{display:none}
  .modal.interaction-modal:has(.reflection-puzzle) h2{font-size:20px;margin:0 50px 2px 0}
  .modal.interaction-modal:has(.reflection-puzzle)>p{font-size:14px;margin:0 50px 6px 0}
  .modal.interaction-modal .reflection-puzzle{width:min(100%,calc((100dvh - 140px) * 16 / 9));margin:0 auto}
  .modal.interaction-modal .reflection-choice span{min-height:40px;font-size:14px}
}

/* ==== Compact version: a phone held sideways (the game's main screen). Kept last, so it outweighs the blocks above.
   The painting fits whole in the middle; every control stands at the edge of the screen, where the thumbs are, inside
   the notch margins and above the home-indicator strip: ☰ and the place top left, sound top right, journal, bag and
   atlas down the left, the lens and «Attività» down the right. The HUD keeps the painting's box (captions, notes and
   the drawer belong to the picture), so a control finds the screen edge through the offsets --edge-*.
   The margins go through --safe-*, which env() fills on a phone; a test can set them by hand on <html>.
   The same query gates the zoom button of a search in search-inn.css. ==== */
#app.immersive [data-focus="activities"] .kit-icon{display:none}
@media (max-height:500px) and (min-aspect-ratio:3/2){
  :root{--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-b:env(safe-area-inset-bottom,0px)}
  #app.immersive .stage:not(.board-stage){--rail:62px;--btn:48px;
    --pw:min(100vw - var(--safe-l) - var(--safe-r) - var(--rail) * 2,100dvh * 16 / 9);--ph:calc(var(--pw) * 9 / 16);
    --pl:calc(var(--safe-l) + (100vw - var(--safe-l) - var(--safe-r) - var(--pw)) / 2);--pr:calc(100vw - var(--pl) - var(--pw));--pt:calc((100dvh - var(--ph)) / 2);
    --edge-l:calc(var(--safe-l) + 8px - var(--pl));--edge-r:calc(var(--safe-r) + 8px - var(--pr));--edge-t:calc(8px - var(--pt));--edge-b:calc(var(--safe-b) + 6px - var(--pt));
    width:100vw;height:100dvh;aspect-ratio:auto;box-shadow:none}
  #app.immersive .stage:not(.board-stage)>:is(.scene,.hud){position:absolute;inset:auto;left:var(--pl);top:var(--pt);width:var(--pw);height:var(--ph)}
  #app.immersive .stage:not(.board-stage)>.scene{box-shadow:0 0 40px #000c}
  /* The bars and their groups dissolve: each control is placed on its own. */
  #app.immersive .stage:not(.board-stage) :is(.hud-top,.hud-bottom.kit-tray){position:absolute;inset:0;margin:0;padding:0;border:0;background:none;box-shadow:none;pointer-events:none}
  #app.immersive .stage:not(.board-stage) .kit-tray::before,#app.immersive .stage:not(.board-stage) .kit-tray::after{display:none}
  #app.immersive .stage:not(.board-stage) :is(.hud-tools,.tray-tools,.hud-controls){display:contents}
  #app.immersive .stage:not(.board-stage) .hud-question{display:none}
  #app.immersive .stage:not(.board-stage) :is(.hud-tools,.tray-tools)>.kit-medallion{position:absolute;width:var(--btn);height:var(--btn);pointer-events:auto}
  #app.immersive .stage:not(.board-stage) :is(.hud-tools,.tray-tools)>.kit-medallion::before{content:none}
  #app.immersive .stage:not(.board-stage) .kit-badge{min-width:18px;height:18px;font-size:12px}
  #app.immersive .stage:not(.board-stage) [data-action="pause"]{left:var(--edge-l);top:var(--edge-t)}
  #app.immersive .stage:not(.board-stage) [data-action="sound"]{right:var(--edge-r);top:var(--edge-t)}
  #app.immersive .stage:not(.board-stage) [data-action="journal"]{left:var(--edge-l);bottom:calc(var(--edge-b) + (var(--btn) + 8px) * 2)}
  #app.immersive .stage:not(.board-stage) [data-action="inventory"]{left:var(--edge-l);bottom:calc(var(--edge-b) + var(--btn) + 8px)}
  #app.immersive .stage:not(.board-stage) [data-action="map"]{left:var(--edge-l);bottom:var(--edge-b)}
  #app.immersive .stage:not(.board-stage) [data-action="hint"]{right:var(--edge-r);bottom:calc(var(--edge-b) + var(--btn) + 14px)}
  /* The place, beside ☰ at the top of the screen. */
  #app.immersive .stage:not(.board-stage) .hud-location{position:absolute;left:calc(var(--edge-l) + var(--btn) + 6px);top:var(--edge-t);pointer-events:none}
  #app.immersive .stage:not(.board-stage) .kit-location h1{font-size:calc(16px * var(--kit-scale))}
  /* «Attività»: the largest medallion, bottom right under the thumb: icon and count, the word only for screen readers. */
  #app.immersive .stage:not(.board-stage) .kit-plate[data-focus="activities"]{position:absolute;right:calc(var(--edge-r) - 2px);bottom:var(--edge-b);width:calc(var(--btn) + 4px);height:calc(var(--btn) + 4px);min-height:0;padding:0;display:grid;place-items:center;border:0;border-image:none;border-radius:50%;background:url('../assets/ui/kit/ui-v2-medaglione.webp') center/100% 100% no-repeat;box-shadow:0 3px 10px #000a;pointer-events:auto}
  #app.immersive .stage:not(.board-stage) .kit-plate[data-focus="activities"] .kit-icon{display:block;width:30px;height:30px}
  #app.immersive .stage:not(.board-stage) .kit-plate[data-focus="activities"]>span:not(.kit-count){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  #app.immersive .stage:not(.board-stage) .kit-plate[data-focus="activities"] .kit-count{position:absolute;top:-4px;right:-4px;font-size:12px}
  /* The search of this place keeps its words: a plate at the foot of the painting, centred, above the home strip. */
  #app.immersive .stage:not(.board-stage) .kit-plate[data-focus="research"]{position:absolute;left:50%;bottom:max(6px,var(--edge-b));transform:translateX(-50%);min-height:40px;pointer-events:auto}
  /* Activities: opens beside its medallion, from the bottom up, as tall as its entries. */
  #app.immersive .stage:not(.board-stage) .activity-drawer{top:auto;bottom:var(--edge-b);right:calc(var(--edge-r) + var(--btn) + 10px);max-height:calc(100dvh - var(--safe-b) - 16px);width:min(330px,46vw);display:flex;flex-direction:column}
  #app.immersive .stage:not(.board-stage) .activity-drawer .kit-panel-body{flex:1;min-height:0;max-height:none}
  #app.immersive .stage:not(.board-stage) .activity-drawer h3{margin:6px 6px 2px}
  #app.immersive .stage:not(.board-stage) .activity-drawer .activity{min-height:40px;padding:4px 8px;gap:10px}
  #app.immersive .stage:not(.board-stage) .activity-drawer .activity .kit-icon{width:26px;height:26px}
  #app.immersive .stage:not(.board-stage) .activity-drawer .activity small{font-size:12px}
  /* The arrival caption, Watson's note and the «not yet» notice: on the painting, under the top row of the screen. */
  #app.immersive .stage:not(.board-stage) .hud .scene-caption{position:absolute;left:6px;top:max(6px,calc(var(--edge-t) + var(--btn) + 6px));margin:0;max-width:calc(50% - 12px);font-size:14px;line-height:1.4;pointer-events:auto}
  #app.immersive .stage:not(.board-stage) .hint-note{position:absolute;top:max(4px,calc(var(--edge-t) + var(--btn) + 6px));left:6px;right:auto;max-width:calc(100% - 12px);margin:0;z-index:7}
  #app.immersive .stage:not(.board-stage) .hint-actions .kit-plate{min-height:40px}
  #app.immersive .stage:not(.board-stage) .hint-actions .kit-medallion{width:44px;height:44px}
  #app.immersive .stage:not(.board-stage) .hud .blocked-action{position:absolute;top:max(6px,calc(var(--edge-t) + var(--btn) + 6px));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);margin:0;z-index:7}
  .toast button{top:0;right:0;min-width:40px;min-height:40px}
  #app.immersive .kit-count{font-size:12px}
}
/* Compact: the evidence table and the closing letter take the whole screen, not a 16:9 box; the rail of tools on the
   left keeps clear of the notch. */
@media (max-height:500px) and (min-aspect-ratio:3/2){
  #app.immersive .stage.board-stage{width:100vw;height:100dvh;aspect-ratio:auto;box-shadow:none}
  #app.immersive .stage.board-stage :is(.kit-medallion,.kit-tray .kit-lens){width:44px;height:44px}
  #app.immersive .stage.board-stage .hud{grid-template-columns:52px minmax(0,1fr)}
  /* Five tools fit the rail even when Safari leaves 280 px; sound stays in Pause → Settings. */
  #app.immersive .stage.board-stage .hud-tools>[data-action="sound"]{display:none}
  #app.immersive .stage.board-stage>.scene{height:100%;aspect-ratio:auto}
  #app.immersive .board-stage .text-button{min-height:40px;font-size:14px}
}
/* Compact, notch and home indicator (viewport-fit=cover): panels keep clear of the rounded sides; the board stays
   above the strip where a swipe up means «Home». */
@media (max-height:500px) and (min-aspect-ratio:3/2){
  #app .modal-backdrop:not(:has(.hunt)){padding-left:max(8px,var(--safe-l));padding-right:max(8px,var(--safe-r))}
  #app.immersive .stage.board-stage>.hud{left:var(--safe-l);right:var(--safe-r);bottom:var(--safe-b)}
}
/* Compact: the title's painted buttons are small on a short screen; each one is touched over the whole gap around it
   (they stand 25 px apart at 280 px of height, so a taller pad would overlap the next one). */
@media (max-height:500px) and (min-aspect-ratio:3/2){
  .title-choice::before{content:'';position:absolute;inset:-2px -24px}
}
/* Without a × a panel closes with a tap outside it: on a short screen a margin wide enough for a finger stays free around
   panels and close-ups (searches and staged conversations fill the screen and keep their own way out), with room below for the hint. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  #app .modal-backdrop:not(:has(.hunt)):not(:has(.vn)){padding:8px max(34px,var(--safe-r,0px)) calc(34px + env(safe-area-inset-bottom)) max(34px,var(--safe-l,0px))}
  .outside-hint{bottom:calc(10px + env(safe-area-inset-bottom))}
}

@media (max-height:560px) and (min-aspect-ratio:1/1){
  .notebook .bookmarks{margin-right:0}
  .notebook .journal-filters{gap:6px}
  .notebook .journal-filters button{min-height:36px}
}
@media (prefers-reduced-motion:reduce){
  .panel-journal .journal-copy{animation:none}
}
/* The notebook on a landscape phone is as tall as the screen allows: without a free strip below it, the tap meant to close it
   (and the hint written there) fell on the book. Now a strip at least a finger high stays free under it, above the home bar. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  #app .modal-backdrop:has(>.panel-journal){padding-bottom:calc(34px + env(safe-area-inset-bottom))}
  .panel-journal .notebook{height:calc(100dvh - 8px - 34px - env(safe-area-inset-bottom))}
  .modal-backdrop:has(>.panel-journal) .outside-hint{bottom:calc(10px + env(safe-area-inset-bottom))}
}
/* The same free strip under every panel on a landscape phone: each height worked out from the screen also leaves out
   the backdrop's top padding and the strip below (--outside), so the panel never runs over the place to tap and its hint. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  #app{--outside:calc(8px + 34px + env(safe-area-inset-bottom))}
  .modal:is(.panel-settings,.panel-credits,.panel-new,.panel-home,.panel-topics,.panel-map) .panel-body{max-height:calc(100dvh - var(--frame-w) * 2 - var(--outside))}
  .modal.panel-map .plan{max-width:min(100%,calc((100dvh - var(--frame-w) * 2 - var(--outside) - 24px) * 1.5))}
  .modal.panel-inventory{width:min(1000px,96vw,calc((100dvh - var(--outside) - 64px) * 1.6))}
  .modal.interaction-modal:has(.dialogue-layout) .dialogue-layout{max-height:calc(100dvh - var(--frame-w) * 2 - var(--outside))}
  .modal.interaction-modal .detail-image img{max-height:calc(100dvh - var(--frame-w) * 2 - var(--outside))}
}
