:root{
  --bg:#06111b;--panel:#0d2030;--panel2:#132b3e;--ink:#f4fbff;--muted:#a8c2d4;
  --cyan:#54e3f2;--cyan2:#1ba6c1;--gold:#ffd66b;--danger:#ff6f75;--ok:#72e69b;
  --line:rgba(255,255,255,.12);--shadow:0 18px 50px rgba(0,0,0,.45)
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none;background:var(--bg);color:var(--ink);font-family:Inter,ui-rounded,"SF Pro Rounded","Segoe UI",system-ui,sans-serif}
body{position:fixed;inset:0}
button{font:inherit;color:inherit;background:#173348;border:1px solid var(--line);border-radius:12px;padding:10px 14px;cursor:pointer;transition:.15s transform,.15s background,.15s border-color;touch-action:manipulation}
button:hover{background:#1d4058;border-color:rgba(84,227,242,.55)}button:active{transform:scale(.98)}button:disabled{opacity:.45;cursor:not-allowed}
button.primary{background:linear-gradient(135deg,#1e9fb8,#2bc9d6);color:#04151d;font-weight:800;border:none}
button.danger{background:#572b36;color:#ffd9dd}button.good{background:#1d5e43;color:#e0ffea}
.hidden{display:none!important}
.rotate-device{display:none;position:fixed;inset:0;z-index:9999;background:radial-gradient(circle at 50% 35%,#123c4d,#040c13 68%);align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:12px;padding:28px}.rotate-device strong{font-size:1.6rem}.rotate-device span{color:var(--muted)}.rotate-phone{width:92px;height:148px;border:5px solid var(--cyan);border-radius:20px;display:grid;place-items:center;font-size:48px;animation:turnPhone 1.6s ease-in-out infinite}@keyframes turnPhone{50%{transform:rotate(90deg)}}
#app{height:100%;height:100dvh;display:grid;grid-template-rows:auto 1fr auto;position:relative}
#hud{height:54px;display:grid;grid-template-columns:1fr 1.5fr 1fr;align-items:center;padding:0 12px;background:rgba(4,17,27,.94);border-bottom:1px solid var(--line);z-index:20;gap:10px}
.hud-left,.hud-right{display:flex;align-items:center;gap:10px}.hud-left{min-width:0}.hud-left strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hud-left span,.hud-right span{color:var(--muted);font-size:.88rem}.hud-center{text-align:center;font-size:.88rem;color:#d7eef7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hud-right{justify-content:flex-end}.hud-btn{padding:6px 11px;font-size:1.2rem}
#viewport{position:relative;display:flex;align-items:center;justify-content:center;min-height:0;background:radial-gradient(circle at 50% 20%,#0b2b3e,#050b12 72%)}
#gameCanvas{display:block;width:min(100vw,calc(100vh * 16/9));height:auto;max-height:100%;aspect-ratio:16/9;background:#102634;image-rendering:auto;box-shadow:var(--shadow)}
#statusBar{height:26px;padding:4px 10px;display:flex;justify-content:space-between;gap:10px;background:#02070b;border-top:1px solid var(--line);font-size:11px;color:#7fa2b7;z-index:30}
.screen-panel{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;text-align:center;background:radial-gradient(circle at 50% 28%,rgba(32,157,174,.38),rgba(3,11,18,.97) 64%),linear-gradient(125deg,#071927,#0b3441);z-index:50;box-shadow:inset 0 0 0 10px #07131d,inset 0 0 0 12px rgba(84,227,242,.2)}.screen-panel:before,.screen-panel:after{content:"";position:absolute;top:50%;width:28px;height:120px;transform:translateY(-50%);border-radius:20px;background:linear-gradient(#17384b,#091923);border:1px solid rgba(255,255,255,.13);box-shadow:0 10px 28px rgba(0,0,0,.4)}.screen-panel:before{left:16px}.screen-panel:after{right:16px}
.screen-panel h1{font-size:clamp(48px,10vw,92px);letter-spacing:.08em;margin:10px 0 0;line-height:.9;text-shadow:0 0 30px rgba(84,227,242,.25)}.subtitle{letter-spacing:.35em;color:var(--cyan);font-weight:700;margin:12px 0 8px}.tagline{color:var(--muted);margin:0 0 22px}.title-actions{display:grid;gap:10px;width:min(360px,76vw);touch-action:manipulation}.title-actions button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.save-summary{margin-top:14px;color:var(--muted);font-size:.85rem}
.pwa-hint{max-width:520px;margin:10px 0 0;color:#c6e8f2;font-size:.78rem;line-height:1.35}
@media(display-mode:standalone),(display-mode:fullscreen){.pwa-hint{display:none}}
.brand-mark{width:88px;height:88px;border-radius:50%;border:4px solid #63deed;box-shadow:0 0 0 6px rgba(84,227,242,.11),0 0 30px rgba(84,227,242,.4);position:relative;background:#0b3f58}.brand-mark:before,.brand-mark:after,.brand-mark span:before,.brand-mark span:after{content:"";position:absolute;left:50%;top:50%;width:18px;height:48px;margin:-24px -9px;border-radius:50%;background:#ecfbff;transform-origin:50% 50%}.brand-mark:after{transform:rotate(90deg)}.brand-mark span:before{transform:rotate(45deg)}.brand-mark span:after{transform:rotate(-45deg)}.brand-mark span{position:absolute;left:50%;top:50%;width:16px;height:16px;transform:translate(-50%,-50%) rotate(45deg);background:#3bd7e5;z-index:2;border:2px solid #fff}
.dialogue{position:absolute;left:4%;right:4%;bottom:4%;z-index:40;padding:18px 18px 14px;background:rgba(7,20,31,.96);border:1px solid rgba(84,227,242,.5);border-radius:18px;box-shadow:var(--shadow);display:grid;grid-template-columns:1fr auto;gap:10px 14px}.dialogue-speaker{font-weight:900;color:var(--cyan);grid-column:1/-1;text-transform:uppercase;letter-spacing:.08em;font-size:.82rem}.dialogue-text{font-size:clamp(15px,2vw,20px);line-height:1.45;align-self:center}.dialogue button{align-self:end}
.modal{position:absolute;inset:0;z-index:80;background:rgba(0,0,0,.68);display:flex;align-items:center;justify-content:center;padding:18px}.modal-card{width:min(900px,96vw);max-height:90%;display:flex;flex-direction:column;background:linear-gradient(180deg,#112b3d,#081925);border:1px solid rgba(84,227,242,.35);border-radius:20px;box-shadow:var(--shadow);overflow:hidden}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0;font-size:1.2rem}.icon-btn{font-size:1.35rem;padding:4px 10px;background:transparent}.modal-body{padding:16px;overflow:auto;min-height:120px}
.menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.menu-tile{min-height:105px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;text-align:left;background:linear-gradient(150deg,#17384e,#0c2231)}.menu-tile strong{font-size:1.05rem}.menu-tile span{font-size:.8rem;color:var(--muted);margin-top:4px}
.list{display:grid;gap:8px}.card{background:rgba(255,255,255,.045);border:1px solid var(--line);border-radius:14px;padding:12px}.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.row.wrap{flex-wrap:wrap}.muted{color:var(--muted)}.small{font-size:.82rem}.tiny{font-size:.72rem}.accent{color:var(--cyan)}.gold{color:var(--gold)}.ok{color:var(--ok)}.danger-text{color:var(--danger)}
.hpbar,.meter{height:9px;background:#07131c;border-radius:10px;overflow:hidden;border:1px solid rgba(255,255,255,.08)}.hpbar>i,.meter>i{display:block;height:100%;background:linear-gradient(90deg,#4bd995,#b0ef7a);transition:width .25s}.hpbar.low>i{background:linear-gradient(90deg,#ff626b,#ffb06b)}
.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.08);font-size:.72rem;border:1px solid var(--line)}.pill-row{display:flex;flex-wrap:wrap;gap:6px}.tabbar{display:flex;gap:6px;overflow:auto;margin-bottom:12px}.tabbar button.active{background:#1f8094}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}.three-col{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.blankion-card{display:grid;grid-template-columns:54px 1fr auto;gap:10px;align-items:center}.creature-mini,.creature-official-mini{width:54px;height:54px;border-radius:50%;border:2px solid var(--ess,#55ddeb);background:#07131d;position:relative;overflow:hidden}.creature-official-mini{object-fit:contain;mix-blend-mode:screen}.creature-mini{background:radial-gradient(circle at 35% 30%,rgba(255,255,255,.28),rgba(0,0,0,.28)),var(--ess,#55ddeb)}.creature-mini:before{content:"";position:absolute;width:28px;height:20px;border-radius:50% 50% 45% 45%;background:rgba(0,0,0,.25);left:13px;top:17px}.creature-mini:after{content:"";position:absolute;width:6px;height:6px;border-radius:50%;background:white;box-shadow:14px 0 white;left:17px;top:21px}
.battle-hud{position:absolute;inset:0;z-index:35;pointer-events:none}.battle-cards{position:absolute;display:flex;gap:8px;max-width:52%}.enemy-cards{right:18px;top:42px}.player-cards{left:18px;top:42px;bottom:auto}.battle-card{min-width:205px;padding:9px 11px;background:rgba(4,17,27,.94);border:1px solid rgba(84,227,242,.28);border-radius:14px;box-shadow:0 8px 20px rgba(0,0,0,.32)}.battle-card .name{font-weight:900}.battle-card .meta{font-size:.76rem;color:var(--muted)}.battle-log{position:absolute;left:12px;right:12px;bottom:94px;height:52px;padding:7px 11px;border-radius:12px;background:rgba(4,17,27,.94);border:1px solid var(--line);font-size:.82rem;overflow:auto}.battle-actions{pointer-events:auto;position:absolute;left:12px;right:12px;bottom:10px;min-height:74px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:8px;background:rgba(3,13,21,.9);border:1px solid rgba(84,227,242,.18);border-radius:15px}.battle-actions button{background:rgba(11,42,59,.98);padding:9px 8px;min-height:46px}.battle-actions button.primary{background:linear-gradient(135deg,#1e9fb8,#2bc9d6)}.move-btn{min-width:0;text-align:left}.move-btn strong,.move-btn span{display:block}.move-btn span{font-size:.68rem;color:var(--muted)}
.toast{position:absolute;left:50%;top:70px;transform:translateX(-50%);z-index:100;background:#0b2535;border:1px solid rgba(84,227,242,.45);padding:10px 16px;border-radius:999px;box-shadow:var(--shadow);font-weight:700;max-width:80%;text-align:center}
.touch-controls{position:absolute;left:0;right:0;bottom:max(10px,env(safe-area-inset-bottom));z-index:25;pointer-events:none;justify-content:flex-end;padding:0 14px;align-items:flex-end;gap:14px}.joystick,.ab-buttons{pointer-events:auto;position:relative;touch-action:none}.joystick{width:132px;height:132px;order:2}.joystick-ring{position:absolute;inset:5px;border-radius:50%;background:rgba(4,21,32,.66);border:2px solid rgba(84,227,242,.24);box-shadow:inset 0 0 30px rgba(0,0,0,.45);backdrop-filter:blur(7px)}.joystick-knob{position:absolute;left:41px;top:41px;width:50px;height:50px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#8cecf3,#16778e);border:2px solid rgba(255,255,255,.55);box-shadow:0 6px 20px rgba(0,0,0,.5);transform:translate(0,0)}.ab-buttons{width:112px;height:100px;order:1}.round{position:absolute;width:56px;height:56px;border-radius:50%;font-weight:900;background:rgba(4,21,32,.82)}.round.a{right:0;top:0;border-color:rgba(84,227,242,.5)}.round.b{left:0;bottom:0;border-color:rgba(255,214,107,.45)}
.capture-screen{position:absolute;inset:0;z-index:70;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(circle,rgba(32,165,184,.24),rgba(2,8,14,.92) 62%);pointer-events:none}.capture-aura{position:absolute;width:220px;height:220px;border:2px solid rgba(111,235,244,.38);border-radius:50%;animation:capturePulse 1s ease-in-out infinite}.capture-seal{width:92px;height:92px;border-radius:50%;background:#0c4961;border:5px solid #78e9f1;box-shadow:0 0 38px #42d9e8;animation:sealFloat .8s ease-in-out infinite alternate;position:relative}.capture-seal:before,.capture-seal:after,.capture-seal span:before,.capture-seal span:after{content:"";position:absolute;left:50%;top:50%;width:13px;height:52px;margin:-26px -6.5px;border-radius:50%;background:#f2feff}.capture-seal:after{transform:rotate(90deg)}.capture-seal span:before{transform:rotate(45deg)}.capture-seal span:after{transform:rotate(-45deg)}.capture-status{margin-top:28px;font-weight:800;letter-spacing:.04em;text-align:center}.capture-card{margin-top:20px;width:min(420px,88vw);padding:16px;border-radius:18px;background:rgba(8,30,43,.96);border:1px solid rgba(84,227,242,.55);text-align:center;box-shadow:var(--shadow)}@keyframes capturePulse{50%{transform:scale(1.16);opacity:.25}}@keyframes sealFloat{to{transform:translateY(-12px) rotate(8deg)}}
.world-map{position:relative;min-height:390px;border-radius:18px;background:linear-gradient(145deg,#0b3d4a,#153a35 45%,#33273f);overflow:hidden;border:1px solid var(--line);padding:22px}.map-route{position:absolute;left:10%;right:10%;top:50%;height:4px;background:rgba(255,255,255,.25);transform:rotate(-5deg)}.map-nodes{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:26px 12px}.map-node{min-height:66px;padding:8px!important;border-radius:14px;text-align:center;font-size:.72rem}.map-node.current{outline:3px solid var(--gold);box-shadow:0 0 20px rgba(255,214,107,.45)}.map-node.done{background:#23664b}.help-nav{display:flex;gap:6px;overflow:auto;margin-bottom:12px}.help-section h3{color:var(--cyan);margin-bottom:5px}.essence-table{width:100%;border-collapse:collapse}.essence-table td,.essence-table th{padding:7px;border-bottom:1px solid var(--line);text-align:left}
.option-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}.option-grid button{min-height:100px;text-align:left}.quest-status{font-size:.7rem;padding:3px 7px;border-radius:999px;background:#18384b}.quest-status.done{background:#20543e}.shop-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.shop-item{display:grid;grid-template-columns:1fr auto;gap:8px;text-align:left}.stats-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.stat{padding:6px;border-radius:8px;background:rgba(255,255,255,.05);text-align:center}.stat b,.stat span{display:block}.stat span{font-size:.65rem;color:var(--muted)}
@media(max-width:760px){#statusBar{display:none}#hud{height:48px;grid-template-columns:1.1fr 1fr}.hud-center{display:none}#viewport{align-items:stretch;justify-content:stretch}#gameCanvas{width:100%;height:100%;max-height:none;aspect-ratio:auto;box-shadow:none}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.menu-tile{min-height:82px}.two-col,.three-col,.shop-grid{grid-template-columns:1fr}.dialogue{bottom:max(8px,env(safe-area-inset-bottom));left:8px;right:8px;padding:12px}.battle-card{min-width:128px;font-size:.75rem;padding:6px 8px}.battle-cards{max-width:82%}.enemy-cards{right:6px;top:38px}.player-cards{left:6px;top:38px;bottom:auto}.battle-log{left:6px;right:6px;bottom:112px;height:58px}.battle-actions{left:5px;right:5px;bottom:max(5px,env(safe-area-inset-bottom));min-height:102px;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:5px}.battle-actions button{font-size:.72rem;padding:6px 4px;min-height:43px}.move-btn{min-width:0}.touch-controls{display:flex!important}.joystick{width:112px;height:112px}.joystick-knob{left:34px;top:34px;width:44px;height:44px}.ab-buttons{width:96px;height:88px}.round{width:50px;height:50px}.screen-panel h1{font-size:46px}.screen-panel{padding-bottom:max(24px,env(safe-area-inset-bottom))}.option-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:repeat(3,1fr)}.world-map{min-height:470px;padding:14px}.map-nodes{grid-template-columns:repeat(3,1fr);gap:18px 7px}.modal{padding:6px}.modal-card{max-height:96%}}
@media(pointer:fine) and (min-width:761px){.touch-controls{display:none!important}}
@media(max-width:760px) and (orientation:portrait){body.gameplay-active .rotate-device{display:flex}}

/* Sur ordinateur, les contrôles clavier restent disponibles sans masquer la zone de jeu. */
@media (hover: hover) and (pointer: fine) {
  .touch-controls { display: none !important; }
}

.capture-official{display:block;width:150px;height:110px;object-fit:contain;mix-blend-mode:screen;margin:-8px auto 8px}
.creature-official-mini.final-art,.capture-official.final-art{mix-blend-mode:normal}
.brand-mark{background:transparent url('assets/official/brand/blankora_universal_emblem.png') center/contain no-repeat;border:0;box-shadow:0 0 34px rgba(43,184,255,.48)}.brand-mark:before,.brand-mark:after,.brand-mark span{display:none}
.capture-seal{background:transparent url('assets/official/brand/blankora_universal_emblem.png') center/contain no-repeat;border:0;box-shadow:0 0 42px rgba(66,217,232,.72)}.capture-seal:before,.capture-seal:after,.capture-seal span{display:none}
.map-node.current:before{content:"";display:block;width:24px;height:24px;margin:0 auto 4px;background:url('assets/official/brand/blankora_universal_emblem.png') center/contain no-repeat;filter:drop-shadow(0 0 6px #62dff4)}
.modal-head h2:before{content:"";display:inline-block;width:25px;height:25px;margin-right:9px;vertical-align:-6px;background:url('assets/official/brand/blankora_universal_emblem.png') center/contain no-repeat}
#hud:after{content:"";position:absolute;left:max(7px,env(safe-area-inset-left));top:50%;width:20px;height:20px;transform:translateY(-50%);background:url('assets/official/brand/blankora_universal_emblem.png') center/contain no-repeat;opacity:.22;pointer-events:none}

@media(pointer:coarse) and (orientation:landscape){#statusBar{display:none}#hud{height:48px}#viewport{align-items:stretch;justify-content:stretch}#gameCanvas{width:100%;height:100%;max-height:none;aspect-ratio:auto;box-shadow:none}.touch-controls{display:flex!important;bottom:max(6px,env(safe-area-inset-bottom));padding:0 max(12px,env(safe-area-inset-right))}.joystick{width:108px;height:108px}.joystick-knob{left:33px;top:33px;width:42px;height:42px}.ab-buttons{width:96px;height:84px}.round{width:48px;height:48px}.battle-actions{bottom:max(5px,env(safe-area-inset-bottom))}.modal-card{max-height:96%}}

@media(orientation:landscape) and (max-height:600px){#hud{height:42px;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}.hud-left span,.hud-right span,.hud-center{font-size:.76rem}.dialogue{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:max(7px,env(safe-area-inset-bottom));padding:10px 12px 9px;border-radius:14px;gap:5px 10px}.dialogue-speaker{font-size:.7rem}.dialogue-text{font-size:15px;line-height:1.3}.dialogue button{padding:8px 13px}.joystick{width:88px!important;height:88px!important}.joystick-knob{left:27px!important;top:27px!important;width:34px!important;height:34px!important}.ab-buttons{width:82px!important;height:72px!important}.round{width:42px!important;height:42px!important}.battle-log{height:43px;bottom:84px}.battle-actions{min-height:70px;grid-template-columns:repeat(4,minmax(0,1fr))}.battle-actions button{min-height:38px}.player-cards{top:38px!important;bottom:auto!important}}
.touch-controls.hidden{display:none!important}

/* BLANKORA UI DNA — compact handheld structure, canonical cyan/gold finish. */
#hud,.modal-card,.dialogue,.battle-card,.battle-log,.battle-actions,.card,.menu-tile{border-color:rgba(84,227,242,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.09),0 7px 20px rgba(0,0,0,.25)}
.modal-card,.dialogue,.battle-card,.battle-log,.battle-actions{outline:1px solid rgba(4,15,23,.8);outline-offset:-4px}
.menu-tile{position:relative;overflow:hidden;background:linear-gradient(145deg,#19445b,#0a2130 68%)}.menu-tile:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:linear-gradient(var(--cyan),var(--gold))}.menu-tile strong{color:#f7fdff;text-shadow:0 1px 0 #031017}.menu-tile:hover{background:linear-gradient(145deg,#21617a,#0d2c3d)}
.hud-btn,.icon-btn{border-radius:9px;border:1px solid rgba(84,227,242,.42);box-shadow:inset 0 0 0 2px rgba(2,14,22,.45)}
.hpbar{height:11px;border:2px solid rgba(3,13,20,.72);box-shadow:inset 0 2px 4px rgba(0,0,0,.35)}
.dialogue-speaker,.modal-head h2{color:var(--cyan);text-shadow:0 0 10px rgba(84,227,242,.25)}


/* Production P04 — opening cinematic */
.intro-cinematic{position:absolute;inset:0;z-index:95;overflow:hidden;background:#02080d;color:#fff;display:flex;align-items:stretch;justify-content:center;isolation:isolate}
.intro-cinematic.hidden{display:none}
.intro-backdrop{position:absolute;inset:-5%;background:radial-gradient(circle at 50% 40%,rgba(61,182,197,.18),transparent 34%),linear-gradient(150deg,#071722 0%,#0a2731 48%,#071018 100%);transform:scale(1.04);transition:background 900ms ease,transform 4s ease;z-index:-3}
.intro-backdrop:after{content:"";position:absolute;inset:0;background-image:radial-gradient(circle at 20% 30%,rgba(255,255,255,.45) 0 1px,transparent 1.7px),radial-gradient(circle at 70% 62%,rgba(94,224,235,.35) 0 1px,transparent 1.5px);background-size:91px 91px,127px 127px;opacity:.35;animation:introDrift 8s linear infinite}
.intro-vignette{position:absolute;inset:0;box-shadow:inset 0 0 150px 45px #000;pointer-events:none;z-index:5}
.intro-brand{position:absolute;left:max(22px,env(safe-area-inset-left));top:max(18px,env(safe-area-inset-top));display:flex;align-items:center;gap:10px;font-weight:900;letter-spacing:.22em;font-size:.82rem;opacity:.8;z-index:8}.intro-brand img{width:30px;height:30px;object-fit:contain}
.intro-visual{position:absolute;inset:9% 8% 21%;display:flex;align-items:center;justify-content:center;transition:opacity .55s ease,transform .8s ease;z-index:1}.intro-visual.enter{opacity:0;transform:scale(1.055)}.intro-visual img{max-width:min(70vw,700px);max-height:64vh;object-fit:contain;filter:drop-shadow(0 22px 28px rgba(0,0,0,.48))}.intro-visual .intro-emblem{width:min(33vw,280px);max-height:none;filter:drop-shadow(0 0 30px rgba(85,225,235,.28))}
.intro-duo{display:flex;align-items:flex-end;justify-content:center;width:100%;height:100%;gap:min(2vw,26px)}.intro-duo img{width:min(31vw,340px);max-height:58vh}.intro-duo img:nth-child(1){transform:translateY(4%) rotate(-2deg)}.intro-duo img:nth-child(2){transform:translateY(-1%) rotate(2deg)}
.intro-caption-wrap{position:absolute;left:8%;right:8%;bottom:max(8%,calc(env(safe-area-inset-bottom) + 20px));text-align:center;z-index:8;text-shadow:0 3px 18px #000}.intro-kicker{font-size:clamp(10px,1.5vw,14px);font-weight:900;letter-spacing:.28em;color:#68e4ee;margin-bottom:8px}.intro-caption{font-size:clamp(20px,3.5vw,38px);line-height:1.16;font-weight:800;max-width:900px;margin:auto;min-height:2.35em}.intro-skip{position:absolute;right:max(18px,env(safe-area-inset-right));top:max(17px,env(safe-area-inset-top));z-index:10;background:rgba(6,18,26,.72);border:1px solid rgba(104,228,238,.55);backdrop-filter:blur(6px);font-size:.8rem;padding:8px 14px}.intro-progress{position:absolute;left:8%;right:8%;bottom:max(4%,env(safe-area-inset-bottom));height:3px;background:rgba(255,255,255,.14);z-index:8;border-radius:9px;overflow:hidden}.intro-progress:after{content:"";display:block;height:100%;width:var(--intro-progress,0%);background:#68e4ee;box-shadow:0 0 12px #68e4ee;transition:width .5s ease}
@keyframes introDrift{from{transform:translate3d(0,0,0)}to{transform:translate3d(-91px,-91px,0)}}
@media(orientation:landscape) and (max-height:600px){.intro-visual{inset:5% 9% 24%}.intro-visual img{max-height:56vh}.intro-caption-wrap{bottom:max(9%,calc(env(safe-area-inset-bottom) + 8px))}.intro-caption{font-size:clamp(18px,3.4vw,28px);min-height:2.2em}.intro-kicker{margin-bottom:4px}.intro-progress{bottom:max(3%,env(safe-area-inset-bottom))}}

/* Production P05 — iPhone Home Screen launch hardening */
#titleScreen{pointer-events:auto;touch-action:manipulation;padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}
#titleScreen .title-actions,#titleScreen .title-actions button{position:relative;z-index:3;pointer-events:auto;touch-action:manipulation;-webkit-user-select:none;user-select:none}
#continueBtn[disabled]{display:block!important;visibility:visible!important}

/* Production P06 — opening at home + reliable iPhone dialogue controls */
.dialogue,.dialogue button,#touchA,#touchB,.joystick{pointer-events:auto;touch-action:manipulation}
.dialogue{z-index:62}
.touch-controls{z-index:61}
.dialogue:not(.hidden)~* #touchControls{pointer-events:none}


/* Production P19 — profils persistants + commandes mobiles */
.player-profile-box{width:min(520px,86vw);margin:14px auto 10px;padding:12px 14px;border:1px solid rgba(84,227,242,.25);border-radius:14px;background:rgba(2,16,25,.72);box-shadow:inset 0 0 26px rgba(0,0,0,.22)}
.player-profile-box>label{display:block;margin-bottom:7px;font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#b9dce8;text-align:left}
.player-profile-row{display:flex;gap:8px;align-items:center}
.player-profile-row input{min-width:0;flex:1;height:43px;border-radius:10px;border:1px solid rgba(84,227,242,.35);background:#061824;color:#fff;padding:0 12px;font:700 16px system-ui;outline:none}
.player-profile-row input:focus{border-color:#54e3f2;box-shadow:0 0 0 2px rgba(84,227,242,.16)}
.player-profile-row button{min-height:43px;white-space:nowrap}
.profile-list{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px;min-height:2px}
.profile-chip{padding:5px 9px;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:rgba(8,34,49,.85);font-size:.76rem;color:#d8edf4}
.profile-chip.active{border-color:#54e3f2;color:#fff;box-shadow:0 0 0 1px rgba(84,227,242,.22)}
/* Joystick à gauche, A/B à droite. */
.touch-controls{justify-content:space-between!important;padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important;gap:18px!important}
.touch-controls .joystick{order:1!important}
.touch-controls .ab-buttons{order:2!important}
@media (max-height:470px){.player-profile-box{margin:7px auto 5px;padding:8px 10px}.player-profile-row input{height:38px}.player-profile-row button{min-height:38px}.profile-list{margin-top:5px}.joystick{width:116px!important;height:116px!important}.joystick-knob{left:33px!important;top:33px!important}}

/* P22 Work-resume combat readability */
.battle-cards{flex-wrap:wrap}.move-btn.selected{border-color:#fff3a6!important;box-shadow:0 0 0 2px rgba(255,214,107,.55),0 7px 18px rgba(0,0,0,.28)}.move-btn .move-effect{color:#d9f6fb;font-size:.64rem;margin-top:2px;white-space:normal}.battle-actions #launchMove:disabled{opacity:.45}
.attack-main strong,.attack-main span{display:block}.attack-main span{margin-top:3px;font-size:.62rem;line-height:1.2;color:#06222c;font-weight:750;white-space:normal}
@media(pointer:coarse) and (orientation:landscape){.battle-cards{max-width:47%}.player-cards{left:max(6px,env(safe-area-inset-left));top:38px;bottom:auto}.enemy-cards{right:max(6px,env(safe-area-inset-right));top:38px}.battle-card{min-width:118px}.battle-actions{max-height:126px;overflow:auto}}

#portableCode{width:100%;box-sizing:border-box;min-height:104px;resize:vertical;background:#071a25;color:#dffaff;border:1px solid rgba(95,220,235,.45);border-radius:12px;padding:10px;font:12px ui-monospace,SFMono-Regular,Menlo,monospace;}

/* P22 QA mobile controls: stable PWA joystick geometry and Safari gesture isolation. */
#joystick{touch-action:none!important;-webkit-user-select:none!important;user-select:none!important;overscroll-behavior:contain;will-change:transform}
#joystickKnob{pointer-events:none;will-change:transform}
@media(pointer:coarse) and (orientation:landscape){
  .touch-controls{padding-left:max(18px,env(safe-area-inset-left))!important;padding-right:max(18px,env(safe-area-inset-right))!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
  .joystick{width:118px!important;height:118px!important;min-width:118px!important;min-height:118px!important}
  .joystick-knob{left:36px!important;top:36px!important;width:46px!important;height:46px!important}
  .ab-buttons{width:104px!important;height:92px!important}.round{width:52px!important;height:52px!important}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:470px){
  .joystick{width:108px!important;height:108px!important;min-width:108px!important;min-height:108px!important}
  .joystick-knob{left:33px!important;top:33px!important;width:42px!important;height:42px!important}
}

#pwaTransferBtn.primary-transfer{border-color:rgba(84,227,242,.72);box-shadow:0 0 0 1px rgba(84,227,242,.16),0 0 18px rgba(84,227,242,.10)}
\n/* V0.1.1 — iPhone title layout and visual repair */
@media(pointer:coarse) and (orientation:portrait){
  #titleScreen{justify-content:flex-start!important;overflow-y:auto!important;padding:max(14px,env(safe-area-inset-top)) 18px max(20px,env(safe-area-inset-bottom))!important;box-shadow:none!important}
  #titleScreen:before,#titleScreen:after{display:none!important}
  #titleScreen .brand-mark{width:58px;height:58px;min-height:58px;margin-top:4px}
  #titleScreen h1{font-size:40px!important;margin-top:6px!important;line-height:1!important}
  #titleScreen .subtitle{font-size:.72rem;margin:5px 0 2px!important}
  #titleScreen .tagline{font-size:.8rem;margin:0 0 8px!important}
  .player-profile-box{width:min(94vw,520px)!important;margin:4px auto 7px!important;padding:9px 10px!important}
  .title-actions{width:min(94vw,520px)!important;gap:7px!important}
  .title-actions button{min-height:44px!important;padding:9px 12px!important}
  .pwa-hint{font-size:.68rem!important;line-height:1.25!important;margin:7px auto 0!important;max-width:94vw!important}
  .save-summary{font-size:.72rem!important;margin-top:7px!important}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){
  #titleScreen{justify-content:flex-start!important;overflow-y:auto!important;padding:7px max(24px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom))!important;box-shadow:none!important}
  #titleScreen:before,#titleScreen:after{display:none!important}
  #titleScreen .brand-mark{width:42px;height:42px;min-height:42px;border-width:2px}
  #titleScreen h1{font-size:30px!important;margin:2px 0 0!important}
  #titleScreen .subtitle{font-size:.58rem;margin:2px 0!important}.tagline{display:none!important}
  .player-profile-box{width:min(620px,88vw)!important;margin:3px auto!important;padding:5px 8px!important}
  .player-profile-box>label{font-size:.65rem}.player-profile-row input{height:34px!important}.player-profile-row button{min-height:34px!important;padding:5px 10px!important}
  .title-actions{width:min(620px,88vw)!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  .title-actions button{min-height:36px!important;padding:6px 9px!important;font-size:.78rem!important}
  .pwa-hint{font-size:.58rem!important;line-height:1.15!important;margin:4px auto 0!important;max-width:88vw!important}.save-summary{font-size:.62rem!important;margin-top:4px!important}
}

/* CANONICAL_STARTERS_BATTLE_LIVE1 — contextual combat HUD */
.battle-card{background:linear-gradient(145deg,rgba(3,15,24,.92),rgba(8,31,42,.84));backdrop-filter:blur(5px);border-color:rgba(154,239,245,.38)}
.battle-log{background:rgba(3,15,22,.82);backdrop-filter:blur(4px)}
.battle-actions{background:linear-gradient(180deg,rgba(2,14,20,.82),rgba(2,12,18,.94));backdrop-filter:blur(6px);border-color:rgba(142,234,242,.32)}
.battle-actions button{background:linear-gradient(145deg,rgba(11,43,57,.92),rgba(10,34,48,.86))}
@media(pointer:coarse) and (orientation:landscape){.battle-log{opacity:.88}.battle-actions{min-height:68px}.battle-actions button{min-height:38px}}
/* Battle Live 2 — terrain-first HUD: the scene stays dominant. */
.battle-card{min-width:168px;padding:7px 9px;background:linear-gradient(145deg,rgba(3,15,24,.76),rgba(8,31,42,.66));backdrop-filter:blur(3px);border-radius:11px}
.battle-card .meta,.battle-card .tiny{font-size:.66rem}.battle-log{left:50%;right:auto;transform:translateX(-50%);width:min(56%,620px);bottom:76px;height:38px;padding:5px 9px;background:rgba(3,15,22,.64);font-size:.72rem;border-radius:10px}
.battle-actions{left:50%;right:auto;transform:translateX(-50%);width:min(76%,820px);bottom:7px;min-height:58px;padding:5px;gap:5px;background:rgba(2,12,18,.76);border-radius:12px}
.battle-actions button{min-height:36px;padding:6px 6px;font-size:.78rem}
@media(pointer:coarse) and (orientation:landscape){.battle-card{min-width:108px;padding:5px 7px}.battle-cards{max-width:42%}.battle-log{width:48%;bottom:68px;height:32px}.battle-actions{width:68%;min-height:54px;max-height:108px}.battle-actions button{min-height:34px;font-size:.68rem}}

/* R4 : fermeture tactile des menus, cible explicite de 44 px minimum. */
#modalClose{min-width:44px;min-height:44px;display:inline-grid;place-items:center;touch-action:manipulation;flex-shrink:0}

/* Mobile Menu V4 — title menu scrollable, compact, touch-friendly */
#titleScreen{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;justify-content:flex-start!important;align-items:center!important;gap:0!important;padding:clamp(14px,3vh,28px) max(16px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))!important;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
#titleScreen:before,#titleScreen:after{display:none!important}
#titleScreen .brand-mark{flex-shrink:0}
#titleScreen h1{flex-shrink:0}
#titleScreen .player-profile-box{flex-shrink:0;max-width:520px;width:100%!important}
#titleScreen .title-actions{display:flex!important;flex-direction:column!important;gap:9px!important;width:min(100%,520px)!important;flex-shrink:0}
#titleScreen .title-actions>button{width:100%;min-height:48px!important;padding:11px 14px!important;font-size:1rem!important;line-height:1.25!important;white-space:normal}
#titleScreen .title-more{width:100%;border:1px solid rgba(84,227,242,.32);border-radius:13px;background:#102b3b;text-align:left;overflow:hidden}
#titleScreen .title-more summary,#titleScreen .title-help summary{cursor:pointer;min-height:46px;padding:12px 16px;font-weight:700;list-style:none;touch-action:manipulation}
#titleScreen .title-more summary::-webkit-details-marker,#titleScreen .title-help summary::-webkit-details-marker{display:none}
#titleScreen .title-more summary{display:flex;justify-content:space-between;align-items:center}
#titleScreen .title-more[open] summary span{transform:rotate(180deg)}
#titleScreen .title-more-actions{display:grid;gap:8px;padding:0 10px 12px}
#titleScreen .title-more-actions button,#titleScreen .title-studio-link{display:block;width:100%;min-height:46px!important;padding:11px 12px!important;font-size:.94rem!important;line-height:1.3!important;text-align:center;border:1px solid rgba(160,230,235,.32);border-radius:11px;background:#1c394c;color:#e7f7fb;text-decoration:none;white-space:normal}
#titleScreen .save-summary{max-width:520px;flex-shrink:0;margin:12px auto 0!important;font-size:.82rem!important;line-height:1.4}
#titleScreen .title-help{max-width:520px;width:100%;flex-shrink:0;margin-top:10px;text-align:left;border-top:1px solid rgba(255,255,255,.15);color:#c4dfeb;font-size:.82rem}
#titleScreen .title-help summary{font-size:.84rem;font-weight:500;min-height:44px;padding:12px 0}
#titleScreen .title-help p{margin:4px 0 12px;line-height:1.45}
#titleScreen :is(button,a,summary,input):focus-visible{outline:3px solid #7beaf7;outline-offset:2px}
@media(pointer:coarse) and (orientation:portrait){#titleScreen{padding-top:max(18px,env(safe-area-inset-top))!important}#titleScreen h1{font-size:clamp(32px,9vw,48px)!important}#titleScreen .title-actions>button{min-height:52px!important}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){#titleScreen{padding-top:10px!important}#titleScreen .brand-mark{width:36px;height:36px;min-height:36px}#titleScreen h1{font-size:28px!important}#titleScreen .title-actions{gap:6px!important}#titleScreen .title-actions>button{min-height:42px!important;padding:8px 12px!important;font-size:.92rem!important}#titleScreen .title-more summary{min-height:42px;padding:9px 12px}#titleScreen .title-help{margin-top:6px}}

/* V5: iOS long-press and drag protection, restricted to game controls. */
#viewport,#gameCanvas,.touch-controls,.touch-controls *,#touchA,#touchB,#joystick,#joystick *{
 -webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important;
 -webkit-tap-highlight-color:transparent!important;touch-action:none!important;
}
#viewport,.touch-controls{overscroll-behavior:none!important}
#app{min-height:0;height:100dvh;overflow:hidden}
#viewport{min-height:0;overflow:hidden}
@media(pointer:coarse) and (orientation:landscape){
 .touch-controls{bottom:max(14px,env(safe-area-inset-bottom))!important;
 padding-left:max(18px,env(safe-area-inset-left))!important;
 padding-right:max(18px,env(safe-area-inset-right))!important}
}

/* V6 — Accueil plein écran, indépendant de la taille du canvas. */
#titleScreen:not(.hidden){
 position:fixed!important;inset:0!important;top:0!important;left:0!important;
 width:100vw!important;width:100dvw!important;height:100vh!important;height:100dvh!important;
 max-height:none!important;min-height:0!important;box-sizing:border-box!important;
 z-index:1000!important;display:flex!important;flex-direction:column!important;
 align-items:center!important;justify-content:flex-start!important;
 overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;
 padding: max(22px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(30px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))!important;
 background:radial-gradient(ellipse at 50% 12%,#14556b 0%,#0b2c40 27%,#071825 68%,#030d16 100%)!important;
 box-shadow:none!important;
}
#titleScreen:not(.hidden)::before,#titleScreen:not(.hidden)::after{display:none!important}
#titleScreen:not(.hidden) .brand-mark{width:clamp(56px,9vh,94px);height:clamp(56px,9vh,94px);min-height:56px;margin:clamp(8px,3vh,26px) 0 10px!important}
#titleScreen:not(.hidden) h1{font-size:clamp(34px,10vw,68px)!important;line-height:1.08!important;margin:6px 0!important;letter-spacing:.075em}
#titleScreen:not(.hidden) .subtitle{margin:5px 0!important}
#titleScreen:not(.hidden) .tagline{display:block!important;margin:5px 0 20px!important}
#titleScreen:not(.hidden) .player-profile-box,#titleScreen:not(.hidden) .title-actions,#titleScreen:not(.hidden) .save-summary,#titleScreen:not(.hidden) .title-help{width:min(100%,480px)!important;max-width:480px!important;box-sizing:border-box}
#titleScreen:not(.hidden) .title-actions{margin-top:12px!important}
#titleScreen:not(.hidden) .title-actions>button{min-height:54px!important}
@media(max-height:740px){
 #titleScreen:not(.hidden){padding-top:max(10px,env(safe-area-inset-top))!important}
 #titleScreen:not(.hidden) .brand-mark{width:52px;height:52px;min-height:52px;margin:4px 0!important}
 #titleScreen:not(.hidden) h1{font-size:clamp(30px,8vw,44px)!important}
 #titleScreen:not(.hidden) .tagline{margin:2px 0 8px!important}
}
@media(orientation:landscape) and (max-height:520px){
 #titleScreen:not(.hidden) .brand-mark{width:34px;height:34px;min-height:34px}
 #titleScreen:not(.hidden) .title-actions>button{min-height:42px!important}
}
