
/* v1.3.20 — smartphone portrait controller HUD only. No simulation changes. */
#portraitControllerHudV1319{display:none}
@media (hover:none) and (pointer:coarse) and (orientation:portrait){
 body.haruna-portrait-pad #game{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important}
 body.haruna-portrait-pad #mobileDriveUI,body.haruna-portrait-pad #mobileRpmHud,body.haruna-portrait-pad #mobileGearHud{display:none!important}
 body.haruna-portrait-pad #portraitControllerHudV1319{display:block!important}
 body.haruna-portrait-pad #onlineRaceHud{display:none!important}
}
#portraitControllerHudV1319{position:fixed;inset:0;z-index:9;pointer-events:none;overflow:hidden;box-sizing:border-box;color:#f3f7fc;font-family:Arial,'Yu Gothic',sans-serif;font-variant-numeric:tabular-nums;background:transparent;container-type:size;--hc:rgba(7,13,22,.72);--hl:rgba(195,217,237,.58);--gold:#f6c654;--green:#56f2a2}
#portraitControllerHudV1319 *{box-sizing:border-box}
#portraitControllerHudV1319 .h19-panel{background:linear-gradient(130deg,rgba(4,9,17,.80),rgba(8,16,28,.65));border:1px solid var(--hl);box-shadow:0 3px 16px rgba(0,0,0,.36),inset 0 0 16px rgba(160,198,239,.035);border-radius:8px}
#portraitControllerHudV1319 .h19-header{position:absolute;top:calc(env(safe-area-inset-top) + 1.1cqh);left:3.4cqw;width:93.2cqw;height:19cqh;display:flex;gap:2cqw;justify-content:space-between;align-items:flex-start}
#portraitControllerHudV1319 .h19-brand{width:41%;padding-top:1cqh;filter:drop-shadow(0 2px 3px #000)}
#portraitControllerHudV1319 .h19-brand strong{display:block;font-size:clamp(22px,8.2cqw,42px);font-weight:1000;line-height:.88;letter-spacing:-.065em;font-style:italic;transform:skew(-7deg);transform-origin:left center}
#portraitControllerHudV1319 .h19-brand b{display:block;margin:1.2cqh 0 0 3.5cqw;color:#ed3443;font-size:clamp(13px,5cqw,26px);font-weight:1000;font-style:italic;line-height:.95;letter-spacing:-.035em;transform:skew(-7deg)}
#portraitControllerHudV1319 .h19-brand small{display:block;margin:1.2cqh 0 0 1cqw;color:#c4cbd4;font-size:clamp(7px,1.9cqw,11px);letter-spacing:.12em;white-space:nowrap}
#portraitControllerHudV1319 .h19-subtitle{margin:2cqh 0 0 1cqw;color:#b4c1d2;font-size:clamp(7px,1.8cqw,11px);line-height:1.5;letter-spacing:.10em}
#portraitControllerHudV1319 .h19-controls{display:flex;gap:5px;margin:1cqh 0 0 1cqw}
#portraitControllerHudV1319 .h19-controls button{pointer-events:auto;touch-action:manipulation;min-width:42px;height:25px;padding:0 6px;border:1px solid rgba(214,232,248,.35);border-radius:4px;background:rgba(7,13,22,.75);color:#e7eff8;font-size:9px;font-weight:900;letter-spacing:.05em}
#portraitControllerHudV1319 .h19-session{width:56%;padding:1.2cqh 2.1cqw 1cqh;text-align:right;background:linear-gradient(90deg,transparent,rgba(4,10,20,.76));border-top:1px solid rgba(190,216,242,.25);border-bottom:1px solid rgba(190,216,242,.32);min-height:14cqh}
#portraitControllerHudV1319 .h19-course{color:#d8e0e9;font-size:clamp(8px,2.2cqw,12px);letter-spacing:.10em;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#portraitControllerHudV1319 .h19-lap{display:flex;align-items:baseline;justify-content:flex-end;gap:3cqw;margin-top:1.5cqh;border-bottom:1px solid rgba(220,236,252,.20);padding-bottom:.5cqh}
#portraitControllerHudV1319 .h19-lap span{font-size:clamp(9px,2.8cqw,14px);font-weight:900;letter-spacing:.08em}
#portraitControllerHudV1319 .h19-lap b{font-size:clamp(18px,5.5cqw,28px);font-style:italic;line-height:1}
#portraitControllerHudV1319 .h19-time{display:flex;justify-content:space-between;align-items:baseline;gap:1cqw;margin-top:1cqh}
#portraitControllerHudV1319 .h19-time span{font-size:clamp(7px,2.1cqw,11px);white-space:nowrap;color:#c8d3df;font-weight:800}
#portraitControllerHudV1319 .h19-time b{font-size:clamp(12px,3.8cqw,19px);letter-spacing:.015em;white-space:nowrap;font-style:italic}
#portraitControllerHudV1319 .h19-time.best b{font-size:clamp(10px,2.7cqw,14px);color:#b5c1cf;font-style:normal}
#portraitControllerHudV1319 .h19-online{position:absolute;top:23cqh;left:2.5cqw;width:40cqw;max-height:25cqh;overflow:hidden}
#portraitControllerHudV1319 #mpOnlineHud{display:block!important;position:relative!important;inset:auto!important;width:100%!important;max-height:none!important;margin:0!important;padding:6px!important;border:1px solid rgba(166,202,236,.55)!important;border-radius:8px 8px 0 0!important;background:rgba(4,10,19,.72)!important;box-shadow:0 3px 12px #0005!important;color:#e7eef7!important;overflow:hidden!important}
#portraitControllerHudV1319 #mpOnlineHud .mpOnlineHead{font-size:clamp(8px,2.4cqw,12px);letter-spacing:.03em;color:#f1f5fa!important}
#portraitControllerHudV1319 #mpOnlineHud .mpOnlineHead:before{content:'●';color:var(--green);font-size:8px;margin-right:2px}
#portraitControllerHudV1319 #mpOnlineHud .mpOnlineHead span:first-child{font-size:0}
#portraitControllerHudV1319 #mpOnlineHud .mpOnlineHead span:first-child:after{content:'ONLINE';font-size:clamp(8px,2.4cqw,12px)}
#portraitControllerHudV1319 #mpOnlineCount{color:#fff!important;font-size:1.1em!important}
#portraitControllerHudV1319 #mpOnlineList{margin-top:4px!important;display:grid!important;gap:2px!important}
#portraitControllerHudV1319 .mpOnlineRow{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:3px!important;align-items:center!important;padding:2px 3px!important;font-size:clamp(7px,2.0cqw,10px)!important;border-bottom:1px solid rgba(255,255,255,.08)!important}
#portraitControllerHudV1319 .mpOnlineRow b{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:inherit!important;color:#e7eef8!important}
#portraitControllerHudV1319 .mpOnlineRow small{font-size:clamp(6px,1.5cqw,8px)!important;color:#aebfd0!important;max-width:15cqw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#portraitControllerHudV1319 .mpOnlineRow.self{background:rgba(40,110,200,.34)!important;border:1px solid rgba(90,166,255,.7)!important;border-radius:2px!important}
#portraitControllerHudV1319 .mpOnlineMore,#portraitControllerHudV1319 .mpOnlineEmpty{font-size:8px;color:#aebfd0}
#portraitControllerHudV1319 .h19-gear{position:absolute;top:31.5cqh;right:2.3cqw;width:22cqw;min-width:72px;height:16.5cqh;min-height:112px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:1cqh .8cqw 1.2cqh;border-radius:12px;background:linear-gradient(160deg,rgba(5,11,23,.90),rgba(7,13,22,.78));border:1px solid #b8cce3;box-shadow:0 0 0 2px #020610,0 0 17px rgba(120,177,250,.20)}
#portraitControllerHudV1319 .h19-gear-label{font-size:clamp(9px,2.7cqw,14px);font-weight:1000;font-style:italic;letter-spacing:.03em}
#portraitControllerHudV1319 .h19-gear-value{font-size:clamp(40px,12.5cqw,68px);font-weight:1000;line-height:.95;font-style:italic;text-shadow:0 0 14px rgba(214,232,255,.40)}
#portraitControllerHudV1319 .h19-pad-status{width:100%;display:flex;justify-content:center;align-items:center;gap:5px;border-top:1px solid rgba(198,222,245,.25);padding-top:5px}
#portraitControllerHudV1319 .h19-pad-status svg{width:18px;height:13px;fill:none;stroke:#dce8f7;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#portraitControllerHudV1319 .h19-pad-status i{width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 7px var(--green)}
#portraitControllerHudV1319 .h19-pad-text{font-size:clamp(7px,2cqw,10px);font-weight:1000;font-style:italic;letter-spacing:.025em}
#portraitControllerHudV1319 .h19-bottom{position:absolute;left:2.5cqw;right:2.5cqw;bottom:calc(env(safe-area-inset-bottom) + 3.5cqh);height:19cqh;display:grid;grid-template-columns:30% 30% 40%;align-items:end;gap:0}
#portraitControllerHudV1319 .h19-mapbox{width:100%;height:100%;position:relative;overflow:hidden;padding:5px;display:flex;flex-direction:column}
#portraitControllerHudV1319 .h19-maphead{font-size:clamp(7px,1.9cqw,10px);font-weight:900;text-align:center;color:#dce8f8;letter-spacing:.05em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}
#portraitControllerHudV1319 #mpMapCanvas{display:block!important;position:relative!important;width:100%!important;height:calc(100% - 17px)!important;max-width:none!important;max-height:none!important;flex:1;min-height:0;object-fit:fill;background:transparent!important;border:0!important;border-radius:4px}
#portraitControllerHudV1319 .h19-speed{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0 2px 1.2cqh;min-height:46px;padding:3px 0;border-bottom:1px solid rgba(210,229,247,.55);background:linear-gradient(90deg,transparent,rgba(4,9,17,.50),transparent)}
#portraitControllerHudV1319 .h19-speed b{font-size:clamp(24px,8.8cqw,42px);line-height:1;font-style:italic;font-weight:1000;letter-spacing:-.04em;text-shadow:0 2px 8px #000}
#portraitControllerHudV1319 .h19-speed span{font-size:clamp(8px,2.2cqw,12px);font-weight:900}
#portraitControllerHudV1319 .h19-tach{width:92%;aspect-ratio:1;max-height:17.5cqh;justify-self:end;align-self:end;filter:drop-shadow(0 3px 8px #0008)}
#portraitControllerHudV1319 .h19-tach svg{width:100%;height:100%;display:block;overflow:visible}
#portraitControllerHudV1319 .h19-tach text{fill:#f0f5fc;font-family:Arial,sans-serif;font-weight:800;paint-order:stroke;stroke:#02040a;stroke-width:.5px}
#portraitControllerHudV1319 .h19-footer{position:absolute;bottom:calc(env(safe-area-inset-bottom) + .9cqh);left:4cqw;right:4cqw;display:flex;justify-content:space-between;align-items:center;font-size:clamp(7px,1.7cqw,10px);letter-spacing:.08em;color:#b1becf;white-space:nowrap;gap:5px}
#portraitControllerHudV1319 .h19-footer span:last-child{color:#e7c56e}
/* Controller portrait mode never borrows the touch-only footer or its tiny canvas HUD. */
@media (max-height:700px) and (orientation:portrait){
 #portraitControllerHudV1319 .h19-header{height:20cqh}
 #portraitControllerHudV1319 .h19-online{top:27cqh;max-height:21cqh}
 #portraitControllerHudV1319 .h19-gear{top:32cqh;height:17cqh;min-height:112px}
 #portraitControllerHudV1319 .h19-bottom{height:20cqh}
 #portraitControllerHudV1319 .h19-brand strong{font-size:7.2cqw}
 #portraitControllerHudV1319 .h19-brand b{font-size:4.4cqw}
}


