/* The villa keeps its puzzle above the instruction card, including feedback. */
.chapter-root.city-bulla{height:auto;min-height:max(700px,100svh);display:grid;grid-template-rows:minmax(470px,1fr) auto;overflow:visible;background:#263e39}
.city-bulla .chapter-world{position:relative;inset:auto;min-height:470px}
.city-bulla .chapter-task{position:relative;inset:auto;margin:0 14px 14px;bottom:auto}
.world-bulla-court{background-image:url('assets/bulla-court.webp')}
.world-bulla-room{background-image:url('assets/bulla-room.webp')}
.world-bulla-wall{background-image:url('assets/bulla-wall.webp')}
.city-bulla .chapter-shade{background:linear-gradient(180deg,#183a39df, #15393350 35%,transparent 65%,#243f39cc)}
.city-bulla .chapter-heading h1{font-size:27px}
.villa-emblem{position:absolute;top:228px;left:25px;right:25px;display:flex;flex-direction:column;align-items:center;gap:18px;color:#ffedc1;text-align:center;text-shadow:0 2px 9px #122e2b}
.villa-emblem>svg{width:110px;height:110px;filter:drop-shadow(0 0 20px #f4d69580)}
.villa-emblem>span{font-size:10px;letter-spacing:1px;line-height:1.7}
.villa-emblem>strong{font:500 24px var(--serif)}
.memory-ready{top:215px;gap:13px}
.city-bulla:has(.memory-ready,.memory-mosaic,.memory-closed){height:100svh;min-height:577px;display:block;position:relative;overflow:hidden;background:var(--bulla-observation-photo) center/cover no-repeat}
.city-bulla:has(.memory-ready,.memory-mosaic,.memory-closed) .chapter-world{position:absolute;inset:0;min-height:0;background:none}
.city-bulla:has(.memory-ready,.memory-mosaic,.memory-closed) .chapter-shade{display:none}
.city-bulla:has(.memory-ready,.memory-mosaic,.memory-closed) .chapter-task{position:absolute;left:14px;right:14px;bottom:max(14px,env(safe-area-inset-bottom));margin:0;z-index:5}
:root{--bulla-observation-photo:url('assets/bulla/q-room.webp');--bulla-mosaic-ink:var(--carthage-answer-lettering);--bulla-mosaic-stone:var(--carthage-answer-depth)}
.villa-real-mosaic{width:140px;height:140px;object-fit:contain}
.memory-clock{position:absolute;top:190px;left:25px;right:25px;z-index:4;display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:wrap;color:#fff0cc;background:#193d35e6;border:1px solid #e6cc9066;border-radius:8px;padding:6px 12px}
.memory-clock strong{font:600 24px var(--serif);min-width:15px}
.memory-clock>span{font-size:11px}
.memory-time-track{width:100%;height:3px;background:#c4c79d35;border-radius:3px;overflow:hidden}
.memory-time-track i{display:block;height:100%;background:#e7c77f}
.memory-mosaic{position:absolute;top:254px;left:50%;transform:translateX(-50%);width:230px;display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:repeating-conic-gradient(#806648 0% 25%,#ccb386 0% 50%) 0 0/7px 7px;padding:9px;border:3px solid #e6ce9f;box-shadow:0 6px 24px #112b29a6;z-index:3}
.memory-tile{height:60px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;border:2px solid #e5c998;background:#3d7470;color:#fff0c5;box-shadow:inset 0 0 12px #1e48467a}
.memory-tile svg{width:30px;height:30px}
.memory-tile span{font-size:8px;font-weight:600}
.tile-sun,.tile-moon{background:#a56245}.tile-leaf{background:#5a7554}.tile-eye{background:#735d6d}
.windrose-mosaic{display:block;top:251px;height:212px;width:212px;padding:0;border:0;border-radius:50%;background:transparent}
.memory-rose{position:absolute;inset:0}.memory-rose svg{width:100%;height:100%}
.memory-rose:is(img){width:100%;height:100%;object-fit:contain}
.windrose-mosaic .memory-tile{position:absolute;width:42px;height:42px;border:1px solid #e8d3a5;border-radius:50%;transform:translate(-50%,-50%);gap:1px}
.windrose-mosaic .memory-tile svg{width:23px;height:23px}.windrose-mosaic .memory-tile span{font-size:6px}
.memory-position-0{left:24%;top:24%}.memory-position-1{left:50%;top:10%}.memory-position-2{left:76%;top:24%}
.memory-position-3{left:10%;top:50%}.memory-position-4{left:50%;top:50%}.memory-position-5{left:90%;top:50%}
.memory-position-6{left:24%;top:76%}.memory-position-7{left:50%;top:90%}.memory-position-8{left:76%;top:76%}
.windrose-mosaic .memory-position-4{width:54px;height:54px;border:2px solid #ffe1a2;box-shadow:0 0 0 4px #b99f6d}.windrose-mosaic .memory-position-4 svg{width:30px;height:30px}.windrose-mosaic .memory-position-4 span{font-size:8px}
.city-bulla .windrose-mosaic .memory-tile{color:var(--bulla-mosaic-ink);background:var(--bulla-mosaic-stone);border:0;border-radius:3px;box-shadow:var(--carthage-answer-shadow)}
.city-bulla .windrose-mosaic .memory-position-4{border:0;box-shadow:var(--carthage-answer-shadow)}
.city-bulla .windrose-mosaic{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;top:28%;width:min(78%,310px);height:auto;border-radius:0;box-shadow:none}
.city-bulla .windrose-mosaic .memory-rose{display:none}
.city-bulla .windrose-mosaic .memory-tile{position:static;transform:none;width:100%;height:auto;aspect-ratio:1;border-radius:4px;background:var(--bulla-memory-stone) center/cover no-repeat;text-shadow:var(--bulla-engraved-shadow);gap:5px}
.city-bulla .windrose-mosaic .memory-tile svg{width:34px;height:34px;filter:drop-shadow(0 1px 0 var(--carthage-answer-depth))}
.city-bulla .windrose-mosaic .memory-tile span{font-size:11px}
:root{--bulla-memory-stone:url('assets/bulla/clean-action.png');--bulla-engraved-shadow:0 1px 0 var(--carthage-answer-depth)}
.memory-closed{position:absolute;top:200px;left:20px;right:20px;display:flex;justify-content:center;align-items:center;gap:10px;color:#fff0c6;text-shadow:0 1px 6px #122e2b;font-size:11px}
.memory-closed svg{height:30px;width:30px}
.city-bulla .villa-symbols{top:264px;left:22px;right:22px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}
.city-bulla .villa-symbols .world-answer{border-radius:7px;min-height:75px;padding:8px 4px;gap:6px;font-size:10px;background:linear-gradient(135deg,#d6c4a2,#bfa275);color:#3d3326;border-width:2px}
.city-bulla .villa-symbols .world-answer svg{width:30px;height:30px;color:#34635e}
.city-bulla .world-answer.activated{background:#f4deab;box-shadow:0 0 22px #ffe6a7aa;transform:none}
.city-bulla .world-answer.eliminated{opacity:.4}
.symbol-sequence{position:absolute;top:202px;left:19px;right:19px;display:flex;gap:7px;align-items:center;justify-content:center;color:#efdab2;z-index:4}
.sequence-tile{width:64px;height:65px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:#214d46e8;border:2px solid #d2bb87;border-radius:4px}
.sequence-tile svg{height:31px;width:31px}
.sequence-tile small{font-size:8px;white-space:nowrap}
.sequence-missing{font:600 30px var(--serif);border-style:dashed;background:#876d48a3}
.symbol-sequence>b{font-size:11px;font-weight:400}
.city-bulla .sequence-answers{top:297px}
.villa-objects{position:absolute;top:237px;left:19px;right:19px;display:flex;align-items:flex-end;gap:10px;z-index:4}
.villa-object{flex:1;min-width:0;min-height:173px;background:linear-gradient(transparent,#b6a57947);border:1px solid #edd6a080;border-radius:6px;color:#ffe8b4;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:9px;padding:12px 3px}
.villa-object svg{width:76px;height:115px;filter:drop-shadow(0 3px 6px #16332e)}
.villa-object span{font-size:10px;background:#173d37e6;border-radius:12px;padding:6px 9px;border:1px solid #cab58166}
.villa-object.found,.villa-object.hinted{background:#bbcc9850;box-shadow:0 0 26px #dff2b4;border-color:#eff3c8}
.water-passage{top:210px;height:210px}
.mosaic-wall{position:absolute;top:202px;left:50%;transform:translateX(-50%);width:170px;z-index:3;background:repeating-conic-gradient(#ba965e 0% 25%,#e2c58e 0% 50%) 0 0/7px 7px;border:3px solid #dfbd7d;padding:9px 9px 5px;box-shadow:0 5px 20px #102c29b0;transition:box-shadow .7s}
.mosaic-wall-panels{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.wall-piece{height:58px;display:grid;place-items:center;background:#203e39;border:1px dashed #b3a47c;color:#aea88b;box-shadow:inset 0 0 12px #071a18}
.wall-piece b{font:400 25px var(--serif)}
.wall-piece svg{height:35px;width:35px}
.wall-piece.restored{background:#497971;color:#ffdf99;border:2px solid #f0d29a;box-shadow:inset 0 0 9px #c0a76e33;animation:piece-restore .5s ease-out}
.wall-piece{position:relative;overflow:hidden}.wall-piece.restored{border:0;background:#d5bc86}.wall-piece.restored svg{position:static;width:100%;height:100%;max-width:none;max-height:none}
.wall-piece:nth-child(1) svg{top:0;left:0}.wall-piece:nth-child(2) svg{top:0;right:0}.wall-piece:nth-child(3) svg{bottom:0;left:0}.wall-piece:nth-child(4) svg{bottom:0;right:0}
.wall-progress{display:block;margin-top:6px;background:#29493af2;color:#fff0c9;font-size:9px;text-align:center;padding:4px 1px}
.mosaic-wall.restored{box-shadow:0 0 40px #ffe8a6}
.villa-final-passage{top:202px;height:210px}
.city-bulla .villa-wall-answers{top:386px;left:17px;right:17px;gap:8px}
.city-bulla .villa-wall-answers .world-answer{min-height:78px;padding:9px 5px;gap:5px;border-radius:7px;font-size:10px}
.villa-wall-answers .world-answer svg{display:none}
/* Bulla relic: the supplied courtyard fills the whole screen, task panel overlaid at the bottom. */
.chapter-root:has(.br-scene){position:relative;height:100svh;min-height:577px;overflow:hidden;background:#c9a06b}
.chapter-root:has(.br-scene) .chapter-world{position:absolute;inset:0;padding:0;min-height:0}
.chapter-root:has(.br-scene) .chapter-shade{display:none}
.chapter-root:has(.br-scene) .chapter-task{position:absolute;left:14px;right:14px;top:70%;bottom:auto;margin:0;z-index:5}
.villa-complete{background-image:linear-gradient(#163d38b0,#132e2df5),url('assets/bulla-wall.webp')}
.villa-task h2{font-size:17px}.villa-task .gesture-instruction{font-size:11px}
@keyframes piece-restore{from{opacity:.5;transform:scale(.75)}to{opacity:1;transform:scale(1)}}
@media(max-width:350px){.city-bulla .chapter-heading h1{font-size:23px}.city-bulla .villa-symbols{left:15px;right:15px;gap:8px}.sequence-tile{width:56px}.symbol-sequence{left:13px;right:13px;gap:5px}.villa-object svg{width:65px}.villa-objects{left:13px;right:13px;gap:8px}.villa-task h2{font-size:15px}.villa-task .gesture-instruction{font-size:10px}}
@media(max-height:700px){.chapter-root.city-bulla{min-height:100svh;grid-template-rows:minmax(470px,1fr) auto}.city-bulla .chapter-heading{top:71px}.city-bulla .chapter-stats{top:130px}}
@media(prefers-reduced-motion:reduce){.wall-piece.restored{animation:none}}
/* Bulla Regia entry: supplied chamber artwork with closed/open door and real objects on the mosaic floor. */
.world-bulla-court:has(.bq-scene){container-type:size;overflow:hidden;background:#8a6f4d}
.bq-scene{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100cqw,calc(100cqh*1072/1920));aspect-ratio:1072/1920;z-index:1;pointer-events:none}
.bq-scene img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.bq-scene .bq-open{opacity:0;transition:opacity 1.1s ease}
.bq-scene.is-open .bq-open{opacity:1}
.bq-objects{position:absolute;inset:0;z-index:3;pointer-events:none}
.bq-objects .dq-object{bottom:9%}
.bq-coin{left:20%;width:16%}
.bq-mosaic{left:50%;bottom:12%;width:23%}
.bq-calendar{left:80%;width:19%}
.city-bulla.carthage-leaving .bq-scene{transition:transform .9s ease-in;transform:translate(-50%,-50%) scale(2.6)}
/* Bulla Regia relic: supplied pillar breaks in three clicks, then the final scene reveals the fragment. */
.world-bulla-wall:has(.br-scene){container-type:size;overflow:hidden;background:#c9a06b}
.br-scene{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100cqw,calc(100cqh*1072/1920));aspect-ratio:1072/1920;z-index:1}
.br-frame{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .55s ease}
.br-frame.br-on{opacity:1}
.br-pillar{position:absolute;left:36%;right:36%;top:5%;bottom:48%;background:none;border:0;cursor:pointer;z-index:2}
.br-pillar:disabled{cursor:default}
.br-scene.breaking .br-frame.br-on{animation:br-shake .45s}
@keyframes br-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
.city-bulla .take-relic.br-relic{position:absolute;inset:auto;left:50%;top:48%;transform:translateX(-50%);z-index:3;animation:none;width:min(32%,160px);height:auto;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:pointer;display:block;filter:drop-shadow(var(--carthage-answer-shadow))}
.take-relic.br-relic img{width:100%;height:auto;display:block;pointer-events:none}
.br-relic:focus-visible{outline:3px solid var(--gold,#efb34a);outline-offset:6px}
.br-relic[hidden]{display:none}
@media(prefers-reduced-motion:reduce){.br-scene.breaking .br-frame.br-on{animation:none}.br-frame{transition:none}}
/* Réflexion : plaques claires sans halo ni bordure */
.city-bulla .villa-symbols .world-answer{border:0;border-radius:0;background:url('assets/ptr/bulla-finished-0.png') center/100% 100% no-repeat;background-color:transparent;box-shadow:none;filter:drop-shadow(var(--carthage-answer-shadow))}
.memory-closed{display:none}
/* A single uncropped-height scene continues behind the entry panel. */
.chapter-root.city-bulla.stage-0{position:relative;display:block;height:100svh;min-height:577px;padding:0;overflow:hidden}
.city-bulla.stage-0 .chapter-world{position:absolute;inset:0;min-height:0;background:none}
.city-bulla.stage-0 :is(.chapter-shade,.chapter-motes){display:none}
.city-bulla.stage-0 .chapter-task{position:absolute;left:14px;right:14px;bottom:14px;margin:0;z-index:8}
.city-bulla.stage-0 .bq-scene{inset:0;width:100%;height:100%;aspect-ratio:auto;transform:none}
.city-bulla.stage-0 .bq-scene img{object-fit:cover;object-position:center}
.city-bulla.stage-0 .bq-objects .dq-object{bottom:29%}
.city-bulla.stage-0 .bq-coin{left:20%;transform:translateX(-50%)}
.city-bulla.stage-0 .bq-calendar{left:80%;transform:translateX(-50%)}
.city-bulla.stage-0 .bq-mosaic{bottom:30%}
.city-bulla .windrose-mosaic{top:200px;width:min(66%,270px)}
.city-bulla .memory-clock{top:165px}
.bulla-revealed-mosaic{position:absolute;top:29%;left:50%;transform:translateX(-50%);width:24%;max-height:120px;object-fit:contain;z-index:3;pointer-events:none;animation:piece-restore .6s ease-out}
@media(max-height:740px){.city-bulla .windrose-mosaic{top:182px;width:190px}.city-bulla .memory-clock{top:150px;padding:3px 8px}.city-bulla.stage-0 .bq-objects .dq-object{bottom:35%}}
/* Keep observation in one vertical flow below the temple/counter toolbar. */
.chapter-root.city-bulla:has(.memory-mosaic){display:grid;grid-template-rows:174px 53px auto auto 1fr;min-height:100svh;height:auto;overflow:visible}
.city-bulla:has(.memory-mosaic) .chapter-world{display:contents}
.city-bulla:has(.memory-mosaic) .memory-ready{grid-row:2;position:static;margin:0}
.city-bulla:has(.memory-mosaic) .memory-clock{grid-row:2;position:relative;inset:auto;margin:0 25px;align-self:stretch}
.city-bulla:has(.memory-mosaic) .windrose-mosaic{grid-row:3;position:relative;inset:auto;transform:none;margin:12px auto 0;width:min(66%,270px)}
.city-bulla:has(.memory-mosaic) .chapter-task{grid-row:4;position:relative;inset:auto;margin:14px 14px 14px;align-self:start}
@media(max-height:740px){.chapter-root.city-bulla:has(.memory-mosaic){grid-template-rows:166px 47px auto auto 1fr}.city-bulla:has(.memory-mosaic) .windrose-mosaic{width:190px}}
