/* Physical phone sizing is separate from the source artwork's design pixels.
   Loaded last so earlier desktop reference proportions remain intact. */
.phone-popup-controls{position:absolute;inset:0;z-index:220;pointer-events:none;}
#game-container .phone-popup-controls>.phone-popup-control{position:absolute;display:block;min-width:0;min-height:0;max-width:none;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent url('/assets/equipment/reference-v2/ui/close-orange.svg') center/contain no-repeat;pointer-events:auto;touch-action:manipulation;cursor:pointer;}
#game-container .phone-popup-controls>.phone-popup-previous{background-image:url('/assets/bag/reference-v1/ui/page-prev.svg');}
#game-container .phone-popup-controls>.phone-popup-next{background-image:url('/assets/bag/reference-v1/ui/page-next.svg');}
#game-container .phone-popup-controls>.phone-popup-control:disabled{opacity:.5;filter:grayscale(1);cursor:default;}
#game-container .phone-popup-control:focus-visible{outline:2px solid #228bc6;outline-offset:2px;}
#game-container [data-phone-control-source]{visibility:hidden!important;pointer-events:none!important;}
#game-container[data-phone-layout="true"] {--popup-text-scale:1;--reference-hud-scale:1;--phone-touch:calc(44 * var(--phone-pixel));--phone-book-width:180px;--phone-profile-width:clamp(152.145px,25.3575cqw,202.86px);}
#game-container[data-phone-layout="true"] :is(.classic-book-dock,.lower-rightbar,.lower-rightbar-toggle) {--phone-book-height:calc(var(--phone-book-width) * var(--book-dock-height-per-width));}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) [data-popup-font-original]:not(h1,h2) {
  font-size:clamp(calc(10 * var(--phone-pixel)),var(--popup-font-original),calc(12 * var(--phone-pixel)))!important;
}
#game-container[data-phone-layout="true"]:not([data-popup-text-measure]) .equipment-ui [data-popup-font-original] {
  font-size:max(var(--popup-font-original),calc(10 * var(--phone-equipment-pixel)))!important;
}
#game-container[data-phone-layout="true"] :is(.recruit-modal-shell,.approved-window-shell,.approved-modal-shell) {
  --panel-text-scale:1;--bag-text-scale:1;
}
#game-container[data-phone-layout="true"] :is(.recruit-modal-shell,.approved-window-shell,.approved-modal-shell) :is(button,summary) {touch-action:manipulation;}
#game-container[data-phone-layout="true"] .recruit-modal-shell {
  width:min(94cqw,calc(92cqh * 16 / 9))!important;height:auto!important;aspect-ratio:16/9!important;top:50%!important;border-width:calc(9 * var(--phone-pixel));
}
#game-container[data-phone-layout="true"] :is(.recruit-modal-close,.window-close,.modal-heading>.icon-button) {
  width:calc(40 * var(--phone-pixel))!important;height:calc(40 * var(--phone-pixel))!important;
  right:calc(-10 * var(--phone-pixel))!important;top:calc(-9 * var(--phone-pixel))!important;z-index:20;
}
#game-container[data-phone-layout="true"][data-approved-ui] #app .game-popup-layer>.approved-window-shell:not(.my-bag-shell):not(:has(.ninja-owned-v2)),
#game-container[data-phone-layout="true"][data-approved-ui] #modal-root>.modal-backdrop>.approved-modal-shell:not(:has(.equipment-ui,[data-classic-v2-shell])) {
  width:min(94cqw,calc(92cqh * 16 / 9))!important;height:auto!important;max-height:92cqh!important;aspect-ratio:16/9!important;scale:1;
}
#game-container[data-phone-layout="true"] :is(.recruit-live-modal,.game-window,.modal) {min-width:0;min-height:0;overscroll-behavior:contain;}
#game-container[data-phone-layout="true"] :is(.recruit-live-modal,.game-window,.modal) :is(input:not([type=checkbox]),select,textarea) {
  min-height:var(--phone-touch);font-size:calc(12 * var(--phone-pixel))!important;
}
#game-container[data-phone-layout="true"] :is(.recruit-live-modal,.game-window,.modal) :is(.button,.sa-action,.nog-button,.formation-action,.game-setting-button) {
  min-height:var(--phone-touch);height:auto;line-height:1.2;white-space:normal;
}
/* Full-width source papers get a readable interior instead of a second shrink. */
#game-container[data-phone-layout="true"] .game-window {overflow:auto!important;}
#game-container[data-phone-layout="true"] .modal:not(.battle-modal) {overflow:auto;}
#game-container[data-phone-layout="true"] .recruit-live-modal>[data-recruit-view]:not(.village-formation):not(.game-manual) {
  max-height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;
}
/* Bag keeps its slots and art while the paper uses the full usable height. */
#game-container[data-phone-layout="true"] .game-popup-layer>.approved-window-shell.my-bag-shell {
  width:min(86cqw,calc(78cqh * 552 / 434))!important;height:78cqh!important;
}
#game-container[data-phone-layout="true"] .my-bag-panel {--bag-text-scale:1;}
#game-container[data-phone-layout="true"] .my-bag-panel :is(button,small,b,strong,.my-bag-count) {font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .my-bag-tabs {left:0;right:0;top:0;height:15%;}
#game-container[data-phone-layout="true"] .my-bag-tabs>button {font-size:calc(10 * var(--phone-pixel));white-space:normal;min-height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .my-bag-grid {gap:calc(5 * var(--phone-pixel));top:25%;height:48%;}
#game-container[data-phone-layout="true"] .my-bag-footer {gap:calc(8 * var(--phone-pixel));bottom:5%;height:16%;}
#game-container[data-phone-layout="true"] .my-bag-blue-button {height:calc(36 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .my-bag-panel .my-bag-close {width:calc(40 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .my-bag-page {width:calc(36 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .my-bag-page-dots>button {width:calc(24 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));background-size:40% 40%;}
#game-container[data-phone-layout="true"] .my-bag-item-popup {left:4%;width:92%;top:18%;max-height:80%;overflow:auto;}
/* Equipment retains the source proportions but drops the .82 paper shrink. */
#game-container[data-phone-layout="true"][data-approved-ui] #modal-root>.modal-backdrop>.approved-modal-shell:has(.equipment-ui) {scale:1;}
#game-container[data-phone-layout="true"] .equipment-ui :is(.equipment-reference-item-popup,.equipment-popup-detail) {overflow:auto!important;}
/* Formations can be clicked without drag. The roster and board scroll separately. */
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] {grid-template-rows:auto auto minmax(0,1fr) auto;gap:calc(5 * var(--phone-pixel));padding:0;}
#game-container[data-phone-layout="true"] .formation-toolbar {flex-wrap:wrap;}
#game-container[data-phone-layout="true"] .formation-layout {min-height:0;grid-template-columns:minmax(0,42fr) minmax(0,58fr);}
#game-container[data-phone-layout="true"] :is(.formation-panel,.formation-pick) {min-height:0;overflow:auto;overscroll-behavior:contain;}
#game-container[data-phone-layout="true"] .formation-slot {min-height:calc(43 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .formation-card {min-height:calc(72 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .formation-header h2 {font-size:calc(18 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .formation-header p {line-height:1.3;}
/* Guide, shop and service cards retain details in scrolling regions. */
#game-container[data-phone-layout="true"] .game-manual-book {grid-template-columns:24% minmax(0,1fr);}
#game-container[data-phone-layout="true"] .game-manual-header>div {min-width:0;}
#game-container[data-phone-layout="true"] .game-manual-search {width:32%;}
#game-container[data-phone-layout="true"] .game-manual-sections {overflow-x:auto;overflow-y:hidden;scrollbar-width:none;touch-action:pan-x;}
#game-container[data-phone-layout="true"] .game-manual-sections::-webkit-scrollbar {display:none;}
#game-container[data-phone-layout="true"] .game-manual-sections>button {flex:none;min-width:12%;min-height:var(--phone-touch);}
#game-container[data-phone-layout="true"] .game-manual-index-list>button {min-height:var(--phone-touch);}
#game-container[data-phone-layout="true"] :is(.village-mall-card-copy,.village-mall-purpose,.village-mall-reason) {height:auto!important;max-height:none!important;line-height:1.3!important;-webkit-line-clamp:unset!important;}
#game-container[data-phone-layout="true"] .village-mall-card {overflow:auto;scrollbar-width:thin;}
#game-container[data-phone-layout="true"] .building-context {width:calc(184 * var(--phone-pixel))!important;min-width:0;max-width:84cqw;height:auto!important;max-height:84cqh;left:50%!important;top:50%!important;transform:translate(-50%,-50%);font-size:calc(10 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));padding:calc(4 * var(--phone-pixel));border-width:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .building-context .building-context-button {flex:none;height:calc(28 * var(--phone-pixel));min-height:calc(28 * var(--phone-pixel));border-width:calc(3 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .building-context .building-context-bottom {flex:none;min-height:calc(28 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .building-context .building-context-bottom>.building-context-button {flex:1;}
#game-container[data-phone-layout="true"] .building-context .building-context-close {width:calc(32 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));right:calc(-30 * var(--phone-pixel));top:calc(-10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"]:has(.building-context) .village-harvest-hover {display:none;}
#game-container[data-phone-layout="true"] .toast {font-size:12px;padding:9px 14px;bottom:76px;max-width:90%;}
/* Reward receipts use viewport pixels because their overlay has no scaled stage. */
#game-container[data-phone-layout="true"] .reward-notification-overlay {padding:16px;font-size:10px;}
#game-container[data-phone-layout="true"] .reward-notification-overlay .reward-notification-dialog {width:400px;gap:6px;padding:12px 12px 10px;border-width:4px;border-radius:12px;}
#game-container[data-phone-layout="true"] .reward-notification-overlay[data-reward-count="1"] .reward-notification-dialog {width:260px;}
#game-container[data-phone-layout="true"] .reward-notification-overlay[data-reward-count="2"] .reward-notification-dialog {width:320px;}
#game-container[data-phone-layout="true"] .reward-notification-heading {gap:8px;padding:0 28px 6px 0;flex:none;}
#game-container[data-phone-layout="true"] .reward-notification-gift {width:32px;height:34px;}
#game-container[data-phone-layout="true"] .reward-notification-heading h2 {font-size:18px;line-height:22px;}
#game-container[data-phone-layout="true"] .reward-notification-heading p {font-size:10px;line-height:12px;margin-top:2px;}
#game-container[data-phone-layout="true"] .reward-notification-star {font-size:22px;}
#game-container[data-phone-layout="true"] .reward-notification-dialog .reward-notification-caption {font-size:10px;line-height:14px;}
#game-container[data-phone-layout="true"] .reward-notification-dialog .reward-notification-items {gap:6px;max-height:none;overflow:visible;flex:none;padding:0;}
#game-container[data-phone-layout="true"] .reward-notification-overlay[data-reward-visible-count="1"] .reward-notification-items {width:116px;max-width:100%;align-self:center;}
#game-container[data-phone-layout="true"] .reward-notification-dialog .reward-notification-item {grid-template-rows:36px 14px minmax(20px,auto);gap:2px;min-height:0;padding:5px 5px 4px;border-radius:6px;}
#game-container[data-phone-layout="true"] .reward-notification-art {width:36px;height:36px;}
#game-container[data-phone-layout="true"] .reward-notification-amount {font-size:12px;line-height:14px;}
#game-container[data-phone-layout="true"] .reward-notification-name {font-size:9px;line-height:10px;}
#game-container[data-phone-layout="true"] .reward-notification-rank {top:3px;right:3px;font-size:9px;line-height:11px;}
#game-container[data-phone-layout="true"] .reward-notification-footer {gap:8px;min-height:0;padding-top:6px;font-size:9px;line-height:12px;}
#game-container[data-phone-layout="true"] .reward-notification-continue {min-width:88px;height:28px;min-height:28px;padding:0 12px;font-size:10px;line-height:12px;}
#game-container[data-phone-layout="true"] .reward-notification-close {top:5px;right:5px;width:28px;height:28px;min-width:28px;min-height:28px;font-size:22px;line-height:24px;}
#game-container .reward-notification-pages {display:flex;align-items:center;justify-content:center;gap:10px;flex:none;font:10px/14px Arial,sans-serif;}
#game-container .reward-notification-pages button {display:grid;place-items:center;width:28px;height:24px;min-height:0;padding:0;border:1px solid #cfbb8f;border-radius:4px;background:linear-gradient(#fffdf2,#f4ebd4);color:#806643;font:700 18px/1 Arial,sans-serif;}
#game-container .reward-notification-pages button:disabled {opacity:.4;cursor:default;}
/* Village HUD uses real pixel floors. Rails occupy deliberate separate bands. */
#game-container[data-phone-layout="true"] .topbar-meter {height:34px;}
#game-container[data-phone-layout="true"] .classic-topbar>.topbar-exp {left:8px;top:7px;width:135px;}
#game-container[data-phone-layout="true"] .classic-topbar>.topbar-chakra {left:150px;top:7px;width:126px;}
#game-container[data-phone-layout="true"] .classic-topbar>.topbar-ryo {right:150px;top:7px;width:115px;}
#game-container[data-phone-layout="true"] .classic-topbar>.topbar-gold {right:8px;top:7px;width:135px;}
#game-container[data-phone-layout="true"] .meter-wood {inset:4px 0 4px 27px;border-width:2px;}
#game-container[data-phone-layout="true"] .topbar-exp .meter-wood {left:30px;}
#game-container[data-phone-layout="true"] .topbar-meter-art,#game-container[data-phone-layout="true"] .topbar-exp .topbar-meter-art {width:32px;height:34px;left:0;top:0;}
#game-container[data-phone-layout="true"] .topbar-exp #player-level {left:0;top:9px;width:32px;font-size:15px;}
#game-container[data-phone-layout="true"] .meter-value,#game-container[data-phone-layout="true"] .topbar-exp .meter-value {font-size:12px;letter-spacing:0;}
#game-container[data-phone-layout="true"] .topbar-chakra .meter-value {right:20px;}
#game-container[data-phone-layout="true"] .topbar-gold .meter-value {right:39px;}
#game-container[data-phone-layout="true"] .topbar-plus {width:24px;height:24px;right:-2px;top:-2px;font-size:20px;}
#game-container[data-phone-layout="true"] .topbar-get {height:24px;right:14px;font-size:10px;}
#game-container[data-phone-layout="true"] .topbar-gold-link {height:24px;width:15px;font-size:14px;}
#game-container[data-phone-layout="true"] .chakra-recovery {font-size:10px;top:-8px;height:13px;width:70px;left:30px;padding:0;}
#game-container[data-phone-layout="true"] .village-shell>.topbar-map {top:43px;height:14px;width:46%;}
#game-container[data-phone-layout="true"] .village-shell>.topbar-shortcuts {top:59px;width:min(66%,620px);gap:4px;}
#game-container[data-phone-layout="true"] .topbar-shortcut {font-size:10px;min-height:46px;}
#game-container[data-phone-layout="true"] .topbar-shortcut-art {width:32px;height:32px!important;}
#game-container[data-phone-layout="true"] .topbar-shortcut small {font-size:10px;}
#game-container[data-phone-layout="true"] .village-shell>.topbar-quest {left:6px;top:50px;width:54px;font-size:12px;}
#game-container[data-phone-layout="true"] .topbar-quest .topbar-shortcut-art {width:40px;height:37px!important;}
#game-container[data-phone-layout="true"] .village-shell>.lower-leftbar {left:6px;top:108px;width:58px;gap:4px;max-height:calc(100% - 184px);overflow-y:auto;scrollbar-width:none;}
#game-container[data-phone-layout="true"] .lower-leftbar button {height:44px;min-height:44px;}
#game-container[data-phone-layout="true"] .lower-leftbar .lower-hud-art {width:32px;height:30px;}
#game-container[data-phone-layout="true"] .lower-leftbar .lower-hud-label {font-size:10px;}
#game-container[data-phone-layout="true"] .priority-mission-badge {font-size:10px;min-width:22px;}
#game-container[data-phone-layout="true"] .village-shell>.left-missions-toggle {left:18px;top:auto;bottom:76px;width:32px;height:28px;font-size:18px;}
#game-container[data-phone-layout="true"] .village-shell>.lower-guide-callout {display:none;}
#game-container[data-phone-layout="true"] .village-shell>.lower-rightbar {right:6px;top:108px;width:62px;gap:2px;max-height:calc(100% - 144px - var(--phone-book-height));overflow:auto;scrollbar-width:none;}
#game-container[data-phone-layout="true"] .lower-rightbar button {height:42px;min-height:42px;}
#game-container[data-phone-layout="true"] .lower-rightbar .lower-hud-art {width:32px;height:30px;}
#game-container[data-phone-layout="true"] .lower-hud-label {font-size:10px!important;}
#game-container[data-phone-layout="true"] .village-shell>.lower-rightbar-toggle {right:21px;top:auto;bottom:calc(var(--phone-book-height) + 8px);width:32px;height:28px;font-size:18px;}
#game-container[data-phone-layout="true"] .village-shell>.formation-power-panel {left:6px;bottom:0;width:var(--phone-profile-width);height:auto;aspect-ratio:var(--profile-panel-aspect);}
#game-container[data-phone-layout="true"] .village-profile-panel .village-profile-name {font-size:10.98825px;-webkit-text-stroke:1.267875px #24391c;}
#game-container[data-phone-layout="true"] .village-profile-caption {font-size:10.143px;-webkit-text-stroke:1.3524px #fff8e8;}
#game-container[data-phone-layout="true"] .village-profile-panel .village-profile-prosperity {font-size:12.6px;font-weight:900;-webkit-text-stroke:.945px #fff0e1;}
#game-container[data-phone-layout="true"] .village-profile-vip {font-size:clamp(11.8335px,calc(var(--phone-profile-width) * .075),15.2145px);-webkit-text-stroke:1.436925px #78204b;}
#game-container[data-phone-layout="true"] .village-shell>.lower-shortcuts {--shortcut-profile-height:calc(var(--phone-profile-width) * var(--profile-panel-height-per-width));--shortcut-label-height:16.1px;left:calc(var(--phone-profile-width) + 14px);right:auto;width:min(132px,calc(100% - var(--phone-profile-width) - var(--phone-book-width) - 24px));gap:6px;}
#game-container[data-phone-layout="true"] .lower-shortcuts .lower-hud-label {font-size:7.475px!important;line-height:1.05;white-space:nowrap;overflow-wrap:normal;}
#game-container[data-phone-layout="true"] .village-shell>.classic-book-dock {right:0;bottom:0;width:var(--phone-book-width);height:auto;aspect-ratio:var(--book-dock-aspect);}
#game-container[data-phone-layout="true"] .classic-book-dock button {min-height:0;}
#game-container[data-phone-layout="true"] .village-shell>.village-land-controls {left:50%;bottom:64px;width:160px;height:32px;gap:4px;}
#game-container[data-phone-layout="true"] .village-land-controls button:is(:first-child,:last-child) {flex-basis:32px;font-size:22px;}
#game-container[data-phone-layout="true"] .village-land-controls .village-land-open {font-size:10px;}
#game-container[data-phone-layout="true"][data-hud="hidden"] .village-shell>.village-land-controls {bottom:8px;}
@media (max-width:760px) {
  #game-container[data-phone-layout="true"] .village-shell>.village-land-controls {left:50%;bottom:8px;}
  #game-container[data-phone-layout="true"] .topbar-shortcut-art {width:28px;height:28px!important;}
  #game-container[data-phone-layout="true"] .topbar-shortcut {font-size:10px;}
}
/* Wrap labels inside their own touch cell; no label paints over its neighbour. */
#game-container[data-phone-layout="true"] :is(.topbar-shortcut,.lower-hud-label,.lower-village-tools button,.lower-settings button) {white-space:normal;overflow-wrap:anywhere;text-align:center;}
#game-container[data-phone-layout="true"] .lower-hud-label {max-width:100%;line-height:1.12;}
#game-container[data-phone-layout="true"] .village-mall {display:flex;flex-direction:column;gap:calc(5 * var(--phone-pixel));overflow:visible!important;}
#game-container[data-phone-layout="true"] .village-mall header {position:static;flex:none;height:calc(25 * var(--phone-pixel));padding-right:calc(35 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall h2 {font-size:calc(18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall header>span {white-space:normal;font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-tabs {position:static;flex:none;height:calc(32 * var(--phone-pixel));overflow-x:auto;overflow-y:hidden;scrollbar-width:none;align-items:stretch;touch-action:pan-x;}
#game-container[data-phone-layout="true"] .village-mall-tabs>button {height:100%!important;flex:1;min-width:calc(64 * var(--phone-pixel));border-width:calc(4 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-status {position:static;height:auto;min-height:calc(17 * var(--phone-pixel));flex:none;}
#game-container[data-phone-layout="true"] .village-mall-cards {position:relative;left:auto;right:auto;top:auto;bottom:auto;flex:1;min-height:0;display:flex;gap:0;margin:0 calc(20 * var(--phone-pixel));padding:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;touch-action:pan-x;}
#game-container[data-phone-layout="true"] .village-mall-cards::-webkit-scrollbar {display:none;}
#game-container[data-phone-layout="true"] .village-mall-cards[data-dragging] {scroll-snap-type:none;user-select:none;cursor:grabbing;}
#game-container[data-phone-layout="true"] .village-mall-slide {flex:0 0 100%;min-width:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:calc(8 * var(--phone-pixel));scroll-snap-align:start;scroll-snap-stop:always;}
#game-container[data-phone-layout="true"] .village-mall-card {display:grid;grid-template-rows:calc(26 * var(--phone-pixel)) calc(60 * var(--phone-pixel)) minmax(0,1fr) calc(30 * var(--phone-pixel));gap:calc(2 * var(--phone-pixel));border-width:calc(4 * var(--phone-pixel));padding:calc(3 * var(--phone-pixel));overflow:hidden;}
#game-container[data-phone-layout="true"] .village-mall-card h3 {position:static;height:auto;white-space:normal;overflow:hidden;line-height:1.15;font-size:calc(11 * var(--phone-pixel));color:#346f90;}
#game-container[data-phone-layout="true"] .village-mall-picture,#game-container[data-phone-layout="true"] .village-mall-picture.building {height:calc(60 * var(--phone-pixel));flex:none;}
#game-container[data-phone-layout="true"] .village-mall-picture :is(img,svg),#game-container[data-phone-layout="true"] .village-mall-picture.building>svg {height:100%;max-height:100%;}
#game-container[data-phone-layout="true"] .village-mall-picture:is(.building,.decor) {height:calc(60 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-picture {margin-bottom:0;}
#game-container[data-phone-layout="true"] .village-mall-picture:is(.item,.material,.skill,.ninja,.decor)>:is(svg,img) {width:calc(60 * var(--phone-pixel));height:calc(60 * var(--phone-pixel));max-width:100%;}
#game-container[data-phone-layout="true"] .village-mall-card-copy {grid-template-rows:minmax(0,1fr) calc(20 * var(--phone-pixel)) calc(14 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));line-height:1.2!important;}
#game-container[data-phone-layout="true"] .village-mall-card-copy :is(small,.village-mall-purpose,.village-mall-reason) {font-size:calc(9 * var(--phone-pixel))!important;line-height:1.2!important;}
#game-container[data-phone-layout="true"] .village-mall-card-copy .village-mall-meta {white-space:normal;flex-wrap:wrap;gap:calc(2 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-price {font-size:calc(13 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .village-mall-price>svg {width:calc(12 * var(--phone-pixel));height:calc(18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-lock {position:static;transform:none;align-self:center;margin-top:auto;line-height:1;}
#game-container[data-phone-layout="true"] .village-mall-lock img {height:calc(22 * var(--phone-pixel));width:calc(18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-lock:has(.village-mall-lock-reason){height:calc(28 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-lock:has(.village-mall-lock-reason)>img{width:calc(12 * var(--phone-pixel));height:calc(18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-lock-reason{font-size:calc(9 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-info {flex:none;padding:calc(4 * var(--phone-pixel)) calc(8 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .village-mall-info.compact {padding:calc(4 * var(--phone-pixel)) calc(8 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-info strong {font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-info p {font-size:calc(9 * var(--phone-pixel));margin:calc(2 * var(--phone-pixel)) 0;line-height:1.2;}
#game-container[data-phone-layout="true"] .village-mall-info>span {font-size:calc(9 * var(--phone-pixel));}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .village-mall :is(.village-mall-purpose,.village-mall-reason,.village-mall-meta,.village-mall-meta span,.village-mall-info p,.village-mall-info>span) {font-size:calc(9 * var(--phone-pixel))!important;line-height:1.2!important;}
#game-container[data-phone-layout="true"] .village-mall-card-copy .village-mall-purpose {height:calc(24 * var(--phone-pixel));max-height:calc(24 * var(--phone-pixel));flex:none;-webkit-line-clamp:2;overflow:hidden;}
#game-container[data-phone-layout="true"] .village-mall-buy {position:static!important;width:100%!important;height:calc(30 * var(--phone-pixel))!important;min-height:0;margin-top:0;}
#game-container[data-phone-layout="true"] .village-mall-card[data-mall-kind="skill"] .village-mall-buy {height:calc(30 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .village-mall .village-mall-arrow {top:50%;transform:translateY(-50%);width:calc(32 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));z-index:5;}
#game-container[data-phone-layout="true"] .village-mall-arrow.prev {left:calc(-25 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-arrow.next {right:calc(-25 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .recruit-modal-shell[data-recruit-shell="building-mall"] .recruit-modal-close {width:calc(36 * var(--phone-pixel))!important;height:calc(36 * var(--phone-pixel))!important;right:calc(-23 * var(--phone-pixel))!important;top:calc(-21 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .village-mall footer {position:static;height:calc(32 * var(--phone-pixel));flex:none;gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall footer>nav {overflow-x:auto;gap:0;min-width:0;}
#game-container[data-phone-layout="true"] .village-mall footer>nav>button {width:calc(28 * var(--phone-pixel));height:calc(28 * var(--phone-pixel));flex:none;background-size:25% 25%;}
#game-container[data-phone-layout="true"] .village-mall .village-mall-bag {min-height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] :is(.village-utility-panel .utility-heading,.village-land-panel header) {padding-right:calc(35 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-layout {grid-template-columns:minmax(0,42fr) minmax(0,58fr);}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-panel {overflow:auto;grid-template-rows:auto auto auto auto auto;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-board {grid-template-rows:repeat(5,calc(49 * var(--phone-pixel)));}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-slot>.formation-character {width:calc(26 * var(--phone-pixel));height:calc(26 * var(--phone-pixel));flex-basis:calc(26 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-slot>.formation-slot-name {height:auto;line-height:1.2;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-pick {overflow:auto;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-toolbar {flex-wrap:wrap;min-height:var(--phone-touch);}
/* PvP owns a separate root. Match the phone's usable landscape and safe area. */
@media (max-width:1200px) and (max-height:600px) {
  .pvp-screen {padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);}
  .pvp-stage {width:100%;height:100%;}
  .pvp-stage :is(.pvp-button,.pvp-turn-line,.pvp-error,.pvp-round,.pvp-battle-name small,.pvp-unit-name,.pvp-team-hud .sa-live-rule-label>small) {font-size:12px;}
  .pvp-stage .pvp-button {min-height:36px;padding:5px 8px;}
  .pvp-stage .pvp-battle-name h1 {font-size:17px;}
  .pvp-stage .pvp-chakra>span>small {font-size:10px;}
  .pvp-stage .pvp-chakra strong {font-size:16px;}
  .pvp-stage .pvp-round {height:auto;min-height:25px;padding:4px 2px;}
  .pvp-stage .pvp-opponent-buffs {font-size:10px;}
}

/* Keep My Ninjas' complete illustrated book and its original coordinates. */
#game-container[data-phone-layout="true"][data-approved-ui] #app .game-popup-layer>.approved-window-shell:has(.ninja-owned-v2),
#game-container[data-phone-layout="true"][data-approved-ui] #modal-root>.modal-backdrop>.approved-modal-shell:has(.ninja-owned-v2) {
  width:min(94cqw,calc(104cqh * 677 / 497))!important;height:auto!important;aspect-ratio:677/497!important;overflow:visible!important;scale:1;
}
#game-container[data-phone-layout="true"] .ninja-owned-v2 :is(.nov2-text,.nov2-value,.nov2-stat-value,.nov2-row-level,.nov2-row-force,.nov2-row-force-label) {font-size:max(2.068cqw,calc(10 * var(--phone-pixel)));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 :is(.nov2-control,.nov2-label,.nov2-class-line,.nov2-skill-label,.nov2-hero-role,.nov2-row-class,.nov2-row-job,.nov2-page-counter,.nov2-match-tip) {font-size:max(1.77cqw,calc(9 * var(--phone-pixel)));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 :is(.nov2-hero-name,.nov2-row-name) {font-size:max(2.215cqw,calc(11 * var(--phone-pixel)));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-menu {font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-menu>nav {width:calc(200 * var(--phone-pixel));max-width:90cqw;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-menu>nav>button {min-height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-development {overflow:auto;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-development-header {font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nog-panel {overflow:auto;}
/* Story overview is rendered directly in screen pixels, outside the scaled paper stage. */
#game-container[data-phone-layout="true"] .story-overview-layer {--phone-pixel:1px;}
#game-container[data-phone-layout="true"] .story-overview-host {width:min(60cqw,106.667cqh)!important;max-width:94cqw!important;max-height:90cqh!important;}
#game-container[data-phone-layout="true"] .story-adventure.sa-overview {max-height:90cqh;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-arc-harvest {gap:3px;font-size:9px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-arc-harvest>b {padding:1px 3px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-arc-harvest>small {font-size:9px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-card {padding:8px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-card h3 {font-size:10px;margin-bottom:4px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-card p {width:58%;font-size:9px;line-height:1.2;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-card>strong {width:58%;font-size:9px;line-height:1.2;margin-top:4px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-card>small {left:8px;bottom:6px;font-size:9px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-ninja {width:46px;height:72px;bottom:-8px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-ninja.naruto {right:50px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-ninja.pain {right:21px;bottom:-5px;}
#game-container[data-phone-layout="true"] .story-overview-host .sa-saga-ninja.sasuke {right:-5px;}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .story-overview-host :is(.sa-arc-harvest,.sa-arc-harvest>b,.sa-arc-harvest>small,.sa-saga-card p,.sa-saga-card p b,.sa-saga-card>strong,.sa-saga-card>small) {font-size:9px!important;}
#game-container[data-phone-layout="true"] .story-overview-layer :is(.sa-close,.sa-page-arrow) {min-width:32px;min-height:32px;}
/* Formation keeps the board on the left and roster on the right. */
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] :is(.button,.formation-action) {min-height:calc(32 * var(--phone-pixel));height:auto;white-space:normal;font-size:calc(10 * var(--phone-pixel));line-height:1.15;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-pick {grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-roster {overflow:auto;grid-auto-rows:calc(74 * var(--phone-pixel));grid-template-rows:none;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-card {grid-template-columns:calc(46 * var(--phone-pixel)) minmax(0,1fr) calc(88 * var(--phone-pixel));height:auto;overflow:visible;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-character {width:calc(46 * var(--phone-pixel));height:calc(46 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-header h2 {font-size:calc(18 * var(--phone-pixel));line-height:1.1;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] :is(.formation-header p,.formation-card p,.formation-card small,.formation-slot-name) {font-size:calc(10 * var(--phone-pixel));line-height:1.25;}
#game-container[data-phone-layout="true"] .equipment-ui {--phone-pixel:var(--phone-equipment-pixel);}
/* School retains its teacher, information frame and two candidate cards. */
#game-container[data-phone-layout="true"] .rs-school-view {overflow:visible!important;}
#game-container[data-phone-layout="true"] .rs-school-title {top:calc(-10 * var(--phone-pixel));font-size:calc(18 * var(--phone-pixel))!important;line-height:1.1!important;}
#game-container[data-phone-layout="true"] .rs-school-info-frame {left:4%;top:8%;width:92%;height:24%;grid-template-columns:21% minmax(0,1fr) 22%;gap:calc(6 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-information {font-size:calc(10 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-info-top {flex-wrap:wrap;gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-teacher {width:21%;height:190%;left:calc(4 * var(--phone-pixel));top:auto;bottom:-25%;}
#game-container[data-phone-layout="true"] .rs-school-info-actions {gap:calc(6 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-info-actions>button {width:100%;height:calc(30 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .rs-school-help {font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .rs-school-candidates {left:4%;right:4%;top:39%;height:52%;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:100%;gap:4%;}
#game-container[data-phone-layout="true"] .rs-school-card {width:100%;height:100%;}
#game-container[data-phone-layout="true"] .rs-school-body,#game-container[data-phone-layout="true"] .rs-school-condition .rs-school-body {height:calc(100% - 44 * var(--phone-pixel));min-height:0;}
#game-container[data-phone-layout="true"] .rs-school-candidates .rs-school-condition .rs-school-body {height:calc(100% - 52 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-header,#game-container[data-phone-layout="true"] .rs-school-condition-header {height:calc(23 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-condition-info {font-size:calc(10 * var(--phone-pixel));gap:calc(2 * var(--phone-pixel));overflow:auto;}
#game-container[data-phone-layout="true"] .rs-school-condition-info>p {flex:none;}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .rs-school-view .rs-school-condition-info [data-popup-font-original] {font-size:calc(9 * var(--phone-pixel))!important;line-height:1.1!important;}
#game-container[data-phone-layout="true"] :is(.rs-school-footer,.rs-school-condition-footer) {height:calc(30 * var(--phone-pixel));bottom:calc(-9 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] :is(.rs-school-footer,.rs-school-condition-footer)>.rs-school-action {height:100%;font-size:calc(10 * var(--phone-pixel))!important;width:calc(90 * var(--phone-pixel));flex-basis:calc(90 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-separator {width:96%;left:2%;right:auto;}
#game-container[data-phone-layout="true"] .rs-school-separator-top {top:34%;}
#game-container[data-phone-layout="true"] .rs-school-separator-bottom {top:91%;}
#game-container[data-phone-layout="true"] .rs-school-page-dots {bottom:0;height:calc(24 * var(--phone-pixel));gap:calc(2 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-view .rs-school-page-dots>button {width:calc(24 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));background-size:30% 30%;}

#game-container[data-phone-layout="true"]:not([data-popup-text-measure]) .ninja-owned-v2 [data-popup-font-original] {font-size:max(var(--popup-font-original),calc(9 * var(--phone-pixel)))!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-hero-name {width:8.86%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label {top:67.2%!important;height:6%!important;line-height:1;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label-text {width:100%;white-space:normal;transform:translate(-50%,-50%);line-height:1;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label-text>span {display:block;}
#game-container[data-phone-layout="true"][data-approved-ui] :is(#app,#modal-root) :is(.game-window,.modal):has(>.ninja-owned-v2)>:is(.section-heading,.modal-heading)>:is(.window-close,.icon-button) {width:calc(36 * var(--phone-pixel))!important;height:calc(36 * var(--phone-pixel))!important;max-width:none!important;right:auto!important;}
#game-container[data-phone-layout="true"][data-approved-ui] #modal-root .modal:has(>.equipment-ui)>.modal-heading>.icon-button {width:calc(32 * var(--phone-equipment-pixel))!important;height:calc(32 * var(--phone-equipment-pixel))!important;right:0!important;top:0!important;}
#game-container[data-phone-layout="true"] .equipment-ui .equipment-reference-bag-tabs>button {flex:1 0 auto;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-card {touch-action:pan-y;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-face {width:calc(46 * var(--phone-pixel));height:calc(46 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-panel {height:100%;align-content:start;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-selected-actions {grid-template-rows:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-popup-layer {top:50%!important;}

/* Phone ink sizes supplied by the user: headings15–18, body10–12, labels9–10. */
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) #modal-root .equipment-ui [data-popup-font-original] {font-size:max(var(--popup-font-original),calc(10 * var(--phone-equipment-pixel)))!important;}
#game-container[data-phone-layout="true"] :is(.recruit-live-modal,.game-window,.modal)>:is(header,.section-heading,.modal-heading) h2 {font-size:calc(18 * var(--phone-pixel));line-height:1.1;}
#game-container[data-phone-layout="true"] .equipment-ui .equipment-slot-filters>.button {flex:1 0 auto!important;font-size:calc(10 * var(--phone-equipment-pixel));padding:0 2px;}
#game-container[data-phone-layout="true"] .equipment-ui :is(.equipment-copy,.equipment-control-label) {font-size:calc(10 * var(--phone-equipment-pixel));}
#game-container[data-phone-layout="true"] .story-overview-host {translate:0 20px;}
#game-container[data-approved-ui][data-phone-layout="true"] .story-adventure.sa-overview>.sa-title {font-size:18px!important;top:-1.4em;}
#game-container[data-phone-layout="true"] .story-fullscreen-host .sa-map-content {top:20%;bottom:20%;}
#game-container[data-phone-layout="true"] .story-fullscreen-host .sa-node-label {height:44px;min-width:95px;max-width:125px;padding:8px 5px;}
#game-container[data-phone-layout="true"] .story-fullscreen-host .sa-node-label>strong {font-size:10px;white-space:normal;line-height:1.15;}
#game-container[data-phone-layout="true"] .story-fullscreen-host .sa-node-label>small {font-size:9px;}
#game-container[data-phone-layout="true"] .story-fullscreen-host .sa-map-footer .sa-action {min-height:32px;font-size:10px;}
/* Each original mission leaf owns its scroll; the main actions stay on the paper. */
.sa-mission-scroll {display:contents;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-mission-book {height:100%;min-height:0;max-height:100%;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-book-leaf {min-height:0;height:100%;overflow:hidden;gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sa-mission-scroll {display:block;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-mission-leaf>.sa-title {font-size:calc(16 * var(--phone-pixel))!important;top:calc(-18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sa-mission-actions {flex:none;min-height:calc(32 * var(--phone-pixel));padding-top:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sa-mission-actions>.sa-action {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-reward-leaf {overflow:auto;}
#game-container[data-phone-layout="true"] .sa-reward-leaf>* {flex-shrink:0;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-draw-heading {font-size:calc(16 * var(--phone-pixel))!important;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-draw-heading>strong {font-size:calc(18 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .sa-worker-card {min-height:calc(40 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-condition-info {justify-content:flex-start;}
/* Synthesis keeps its input/result column and the original4×4 ninja pool. */
#game-container[data-phone-layout="true"] .rs-synth-view {overflow:visible!important;}
#game-container[data-phone-layout="true"] .rs-synth-tabs {margin:0 5% 0 25%;height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-title {left:0;top:calc(-10 * var(--phone-pixel));width:24%;height:calc(36 * var(--phone-pixel));font-size:calc(18 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-tabs>button {height:100%;font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-columns {height:calc(100% - 70 * var(--phone-pixel));gap:6%;padding:calc(8 * var(--phone-pixel)) 4% 0;}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-left>h3 {font-size:calc(12 * var(--phone-pixel));margin-bottom:calc(12 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-input {width:calc(40 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));flex-basis:calc(40 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-input>span:not(.ninja-grade-portrait) {top:100%;font-size:calc(9 * var(--phone-pixel));line-height:1.15;}
#game-container[data-phone-layout="true"] .rs-synth-result-well {left:0;right:0;bottom:0;height:43%;}
#game-container[data-phone-layout="true"] .rs-synth-result-grades {padding:calc(5 * var(--phone-pixel)) 0 0;gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-result-grades>div>img {width:calc(32 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-face-grid {gap:calc(6 * var(--phone-pixel));justify-items:center;}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-face {width:calc(36 * var(--phone-pixel));height:calc(36 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-status {bottom:calc(37 * var(--phone-pixel));left:3%;right:3%;max-height:calc(26 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-footer {bottom:0;left:18%;right:18%;gap:calc(30 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-action {width:calc(130 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-page-arrow {top:45%;}

#game-container[data-phone-layout="true"] .village-mall-card {overflow:hidden;padding:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-card h3 {position:static;height:auto;min-height:calc(24 * var(--phone-pixel));flex:none;line-height:1.15;font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-mall-lock {bottom:0;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-mission-leaf {overflow:visible;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-mission-leaf>.sa-title {position:static;flex:none;margin:0;max-width:calc(100% - 34 * var(--phone-pixel));font-size:calc(16 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .sa-mission-leaf>.sa-close {top:0;right:0;width:calc(32 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sa-progress-buttons>button {min-width:calc(28 * var(--phone-pixel));min-height:calc(28 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
@media (max-width:1200px) and (max-height:600px) {.pvp-stage .pvp-button {font-size:10px;} .pvp-stage .pvp-battle-name h1 {font-size:16px;}}

#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-panel {grid-template-rows:auto auto minmax(0,1fr) auto auto;overflow:hidden;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-board {height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-board>.formation-slot {touch-action:pan-y;}
#game-container[data-phone-layout="true"] .village-formation[data-recruit-view="formation"] .formation-selection {line-height:1.15;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-draw-heading {font-size:calc(16 * var(--phone-pixel))!important;}
@media (max-width:700px) {
  #game-container[data-phone-layout="true"] {--phone-book-width:170px;}
}

#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) :is(h1,h2)[data-popup-font-original] {font-size:clamp(calc(15 * var(--phone-pixel)),var(--popup-font-original),calc(18 * var(--phone-pixel)))!important;}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) :is(button,summary)[data-popup-font-original]:not(.sa-arc-card,.sa-saga-card) {font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .game-manual-header {height:calc(40 * var(--phone-pixel));padding-right:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-header>div {padding-left:calc(26 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-header>div>img {width:calc(22 * var(--phone-pixel));height:calc(26 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-header h2 {font-size:calc(16 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-sections {height:calc(34 * var(--phone-pixel));align-items:center;}
#game-container[data-phone-layout="true"] .game-manual-sections>button {height:calc(30 * var(--phone-pixel));min-height:calc(30 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-book {top:calc(78 * var(--phone-pixel));bottom:calc(24 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-index {padding-bottom:calc(34 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-index-pages {bottom:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-index-pages>button {width:calc(28 * var(--phone-pixel));height:calc(28 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .game-manual-footer {height:calc(24 * var(--phone-pixel));}

#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) :is(.recruit-modal-shell,.building-context) [data-popup-font-original] {line-height:1.2!important;}
#game-container[data-phone-layout="true"] .village-land-panel :is(p,small,.village-land-action) {font-size:calc(10 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .village-land-map {grid-template-rows:repeat(2,calc(54 * var(--phone-pixel)));gap:calc(14 * var(--phone-pixel));margin-top:calc(12 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-land-map h3 {font-size:calc(10 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .village-land-panel .village-land-action {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .village-land-panel footer {flex:none;}

/* The profile and original Story book remain on the bottom baseline. */
#game-container[data-phone-layout="true"] .village-shell>.formation-power-panel,
#game-container[data-phone-layout="true"] .village-shell>.classic-book-dock {bottom:0;}
#game-container[data-phone-layout="true"] .my-bag-panel .my-bag-page {width:calc(36 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));}

/* Fit the book's dense ink inside its existing painted controls. */
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .ninja-owned-v2 :is(.nov2-label,.nov2-class-line,.nov2-control,.nov2-control>span,.nov2-skill-label-text,.nov2-skill-label-text>span) {font-size:calc(9 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-label {left:70.5%!important;width:9%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-class-line {left:70.5%!important;top:39.4%!important;width:25.5%!important;height:9%!important;white-space:normal;line-height:1.15;transform:none;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 :is(.nov2-dismiss,.nov2-locate,.nov2-equipment) {top:33.8%!important;height:5.7%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-dismiss {left:69.7%!important;width:8.2%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-locate {left:78.3%!important;width:6.8%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-equipment {left:85.5%!important;width:11.7%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 :is(.nov2-dismiss,.nov2-locate,.nov2-equipment)>span {transform:none;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label:not(.nov2-basic-label) {left:75%!important;width:9.8%!important;}
/* Local edit: the Signature label sits over its own (4th) tile, not on top of the Special label. */
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label.nov2-signature-label {left:85.3%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-label-text>span {white-space:nowrap;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-plus {width:calc(16 * var(--phone-pixel))!important;height:calc(16 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-pager {width:calc(24 * var(--phone-pixel))!important;height:calc(24 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .village-land-job,
#game-container[data-phone-layout="true"] .village-land-job strong {font-size:calc(10 * var(--phone-pixel));line-height:1.2;}
#game-container[data-phone-layout="true"] .my-bag-panel .my-bag-detail-close {width:calc(32 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));background-size:50% 50%;}
#game-container[data-phone-layout="true"] .my-bag-item-popup>header {min-height:calc(28 * var(--phone-pixel));padding-right:calc(32 * var(--phone-pixel));}

/* Setup uses the same screen-space board, with readable phone-sized ink. */
#game-container[data-phone-layout="true"] .story-fullscreen-host>.sa-setup {--phone-pixel:1px;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-battle-bars {top:36px;height:22px;}
#game-container[data-phone-layout="true"] .sa-setup .sa-setup-objectives .sa-live-rule-label {top:3px;gap:5px;}
#game-container[data-phone-layout="true"] .sa-setup .sa-setup-objectives .sa-live-rule-label>b {font-size:11px;}
#game-container[data-phone-layout="true"] .sa-setup .sa-setup-objectives .sa-live-rule-label>small {font-size:9px;line-height:1.1;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-battle-bars>strong {height:22px;font-size:11px;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-mission {top:60px;height:18px;}
#game-container[data-phone-layout="true"] .sa-setup-mission h2 {font-size:14px;}
#game-container[data-phone-layout="true"] .sa-setup :is(.sa-setup-mode,.sa-setup-stage,.sa-setup-stage>b) {font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-board-labels {top:79px;height:11px;font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup-board-labels>span {flex-direction:row;align-items:center;gap:4px;}
#game-container[data-phone-layout="true"] .sa-setup-board-labels :is(b,small) {font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup>:is(.sa-battle-board,.sa-setup-brief,.sa-setup-intel) {top:92px;bottom:120px;}
#game-container[data-phone-layout="true"] .sa-setup>:is(.sa-setup-brief,.sa-setup-intel) {overflow:auto;scrollbar-width:thin;}
#game-container[data-phone-layout="true"] .sa-setup :is(.sa-setup-brief,.sa-setup-intel)>h3 {font-size:10px;}
#game-container[data-phone-layout="true"] .sa-setup :is(.sa-setup-brief dt,.sa-setup-brief>p,.sa-setup-intel>p,.sa-class-rule) {font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup :is(.sa-setup-brief dd,.sa-setup-intel>strong,.sa-setup-enemy-classes>span) {font-size:10px;}
#game-container[data-phone-layout="true"] .sa-setup .sa-setup-slot-number {font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-hint {top:auto;left:3cqw;right:3cqw;bottom:102px;height:14px;flex-direction:row;align-items:center;justify-content:center;gap:10px;white-space:nowrap;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-hint>strong {font-size:10px;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-hint>:is(span,small) {font-size:9px;line-height:1.1;}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-roster-heading {top:auto;bottom:58px;height:12px;font-size:9px;}
#game-container[data-phone-layout="true"] .sa-setup-actions>:is([data-story-action="setup-finish"],[data-kage-action="invade-setup-finish"])>small {font-size:9px;}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-worker-card {height:auto;min-height:calc(54 * var(--phone-pixel));}
#game-container[data-approved-ui][data-phone-layout="true"] [data-recruit-shell="story-mission"] .sa-worker-card>strong {display:block;white-space:normal;font-size:calc(9 * var(--phone-pixel))!important;line-height:1.15;}

#game-container[data-phone-layout="true"] .rs-synth-left {display:flex;flex-direction:column;overflow:auto;scrollbar-width:thin;}
#game-container[data-phone-layout="true"] .rs-synth-left>* {flex-shrink:0;}
#game-container[data-phone-layout="true"] .rs-synth-inputs {margin-bottom:calc(24 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-result-well {position:relative;left:auto;right:auto;bottom:auto;width:100%;height:calc(85 * var(--phone-pixel));margin-top:calc(10 * var(--phone-pixel));border-width:calc(6 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-view .rs-synth-result-well>h3 {position:static;margin:0;height:calc(14 * var(--phone-pixel));font-size:calc(12 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-synth-result-grades {padding:calc(2 * var(--phone-pixel)) 0 0;}
#game-container[data-phone-layout="true"] .rs-synth-result-grades>div>strong {margin-top:calc(2 * var(--phone-pixel));}
@media (max-width:1200px) and (max-height:600px) {
  .pvp-preparation-header .pvp-battle-name {top:4px;}
  .pvp-preparation-header .pvp-battle-name h1 {font-size:16px;}
  .pvp-preparation-header .pvp-battle-name small {font-size:10px;line-height:1.2;margin-top:3px;}
  .pvp-preparation-header .pvp-match-hud {top:50px;height:26px;}
  .pvp-preparation-header .sa-live-health {top:-11px;font-size:9px;}
  .pvp-preparation-header .sa-live-rule-label {top:6px;gap:5px;}
  .pvp-preparation-header .sa-live-rule-label>b {font-size:12px;}
  .pvp-stage .pvp-preparation-header .sa-live-rule-label>small {font-size:10px;}
  .pvp-preparation-header .pvp-round {height:26px;font-size:10px;}
  .pvp-lobby-scroll {inset:84px 0 130px;}
  .pvp-preparation-brief h2,.pvp-preparation-intel h2 {font-size:15px;line-height:1.1;}
  .pvp-preparation-brief p,.pvp-preparation-intel p,.pvp-preparation-brief dt,.pvp-player-list>li {font-size:10px;}
  .pvp-preparation-brief dd,.pvp-player-list strong {font-size:11px;}
  .pvp-stage :is(.pvp-record>div,.pvp-player-list small,.pvp-player-list b,.pvp-preparation-label,.pvp-preparation-hint,.pvp-roster-heading>span) {font-size:9px;}
  .pvp-record h3,.pvp-preparation-hint>strong,.pvp-record b {font-size:12px;}
  .pvp-preparation-field {grid-template-rows:14px minmax(0,1fr) 27px;gap:4px;}
  .pvp-selection-count {font-size:11px;}
  .pvp-preparation-dock {bottom:6px;height:112px;grid-template-columns:minmax(0,1fr) 25cqw;}
  .pvp-roster-tray {grid-template-rows:12px minmax(0,1fr);}
  .pvp-roster-heading {font-size:10px;}
  .pvp-roster-card {grid-template-rows:12px minmax(0,1fr) 12px;}
  .pvp-roster-card>strong,.pvp-roster-card>small {font-size:9px;}
  .pvp-find-match {gap:4px;padding:2px 3px;}
  .pvp-find-match .pvp-button {font-size:10px;min-height:32px;padding:3px;}
  .pvp-room-actions {height:32px;flex:0 0 32px;}
  .pvp-room-form {height:32px;flex:none;}
  .pvp-room-form input {font-size:10px;}
  .pvp-find-match>.pvp-button {height:32px;flex:none;}
}

#game-container[data-phone-layout="true"] .quest-board[data-quest-board] {grid-template-rows:calc(40 * var(--phone-pixel)) calc(32 * var(--phone-pixel)) calc(18 * var(--phone-pixel)) minmax(0,1fr) calc(34 * var(--phone-pixel)) calc(32 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board .mission-board-heading {padding-right:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board :is(.mission-tab,.mission-family-link,.mission-manual-link,.mission-action),
#game-container[data-phone-layout="true"] .quest-board .mission-board-pager .mission-action {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));line-height:1.15;}
#game-container[data-phone-layout="true"] .quest-board .mission-board-cards {grid-template-rows:repeat(2,minmax(calc(130 * var(--phone-pixel)),1fr));overflow:auto;scrollbar-width:thin;}
#game-container[data-phone-layout="true"] .quest-board .mission-card {grid-template-columns:calc(30 * var(--phone-pixel)) minmax(0,1fr);padding:calc(6 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board .mission-card .mission-symbol {width:calc(30 * var(--phone-pixel));height:calc(34 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board .mission-card .mission-copy {grid-template-rows:calc(14 * var(--phone-pixel)) minmax(calc(32 * var(--phone-pixel)),1fr) calc(12 * var(--phone-pixel)) calc(32 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board .mission-card .mission-card-footer {gap:calc(4 * var(--phone-pixel));}
@media (max-width:1200px) and (max-height:900px) {
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] {font-size:12px;line-height:1.3;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] .game-settings-heading h2 {font-size:20px;line-height:24px;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] .game-settings-heading p {font-size:12px;line-height:16px;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] :is(.game-setting-card,.game-settings-save) h3 {font-size:16px;line-height:20px;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] .game-setting-line>span {font-size:13px;line-height:18px;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] :is(.game-setting-note,.game-setting-status,.game-settings-device,.game-settings-footnote) {font-size:12px;line-height:17px;}
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] .game-setting-button,
  #mobile-settings-root .game-settings-panel[data-recruit-view="game-settings"] .game-setting-fullscreen>.game-setting-button {font-size:13px;line-height:18px;}
}

#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .ninja-owned-v2 .nov2-row-name {font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-hero-name {width:10%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-class-line {left:54.7%!important;top:41.5%!important;width:40.5%!important;height:4%!important;white-space:nowrap;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-class-line+.nov2-text {top:46.1%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-plus[aria-label^="Penguatan ATK"]+.nov2-text {top:62.8%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-dismiss {width:8%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-locate {left:77.8%!important;width:6.5%!important;}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-equipment {left:84.8%!important;}
#game-container[data-phone-layout="true"] .quest-board[data-quest-board] {grid-template-rows:calc(32 * var(--phone-pixel)) calc(28 * var(--phone-pixel)) calc(14 * var(--phone-pixel)) minmax(0,1fr) calc(24 * var(--phone-pixel)) calc(28 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board .mission-board-cards {grid-template-rows:none;grid-auto-rows:calc(130 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .quest-board :is(.mission-tab,.mission-family-link,.mission-manual-link),
#game-container[data-phone-layout="true"] .quest-board .mission-board-pager .mission-action {height:calc(28 * var(--phone-pixel));min-height:calc(28 * var(--phone-pixel));}

/* A right control rail and short horizontal assistance tray free space for the arena. */
#game-container[data-approved-ui][data-phone-layout="true"] .story-tactical-backdrop>.tactical-modal[data-battle-rules="reference-v1"] {grid-template-rows:calc(86 * var(--phone-pixel)) minmax(0,1fr) calc(48 * var(--phone-pixel));scrollbar-gutter:auto;}
#game-container[data-approved-ui][data-phone-layout="true"] .story-tactical-backdrop>.tactical-modal[data-battle-rules="reference-v1"][data-assistance-hidden="true"] {grid-template-rows:calc(86 * var(--phone-pixel)) minmax(0,1fr) calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"]>.sa-live-battle-header {height:calc(86 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-battle-rules {top:calc(44 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));right:calc(116 * var(--phone-pixel));left:calc(36 * var(--phone-pixel));grid-template-columns:minmax(0,1fr) calc(60 * var(--phone-pixel)) minmax(0,1fr);}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-team {height:calc(22 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-rule-label {top:calc(5 * var(--phone-pixel));gap:calc(5 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-round {height:calc(24 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-class-rule {top:calc(70 * var(--phone-pixel));right:calc(116 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-class-rule>svg {width:calc(14 * var(--phone-pixel));height:calc(14 * var(--phone-pixel));flex-basis:calc(14 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"]>.tactical-play-layout {margin-right:calc(108 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-health {font-size:calc(9 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-rule-label>b {font-size:calc(12 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-rule-label>small {font-size:calc(9 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .sa-live-class-rule {font-size:calc(9 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"]>.reference-battle-actions {top:calc(86 * var(--phone-pixel));left:auto;right:calc(4 * var(--phone-pixel));width:calc(100 * var(--phone-pixel));height:auto;flex-direction:column;gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-battle-actions>button {width:100%;min-width:0;height:calc(28 * var(--phone-pixel));min-height:0;font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"]>.reference-battle-dock {position:static;display:block;height:calc(48 * var(--phone-pixel));padding:calc(4 * var(--phone-pixel)) calc(108 * var(--phone-pixel)) calc(4 * var(--phone-pixel)) calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"][data-assistance-hidden="true"]>.reference-battle-dock {height:calc(4 * var(--phone-pixel));padding:0;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-item-tray {height:calc(40 * var(--phone-pixel));padding:calc(2 * var(--phone-pixel));border-width:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-item-tray[hidden] {display:none;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-item-tray>#battle-items {height:calc(30 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items>.battle-item {height:100%;grid-template-columns:calc(24 * var(--phone-pixel)) minmax(0,1fr);grid-template-rows:calc(15 * var(--phone-pixel)) minmax(0,1fr);border-width:calc(1 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items .battle-item-heading {position:static;grid-column:2;grid-row:1;height:calc(15 * var(--phone-pixel));padding:0;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items :is(.battle-item-name,.battle-item-level,.battle-item-stock,.battle-item-stock-label,.battle-item-stock>strong) {font-size:calc(9 * var(--phone-pixel))!important;line-height:1.15;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items .battle-item-level {position:absolute;top:auto;right:auto;left:calc(26 * var(--phone-pixel));bottom:calc(1 * var(--phone-pixel));display:block;height:calc(11 * var(--phone-pixel));min-width:0;padding:0 calc(2 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items .battle-item-art {grid-column:1;grid-row:1 / 3;width:calc(24 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #battle-items .battle-item-stock {grid-column:2;grid-row:2;height:100%;justify-content:flex-end;padding-right:calc(2 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-battle-dock>.battle-bottom-toolbar {position:absolute;right:calc(4 * var(--phone-pixel));top:calc(168 * var(--phone-pixel));width:calc(100 * var(--phone-pixel));height:calc(106 * var(--phone-pixel));grid-template-rows:calc(60 * var(--phone-pixel)) calc(30 * var(--phone-pixel));gap:calc(4 * var(--phone-pixel));padding:calc(2 * var(--phone-pixel));border-width:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-toolbar-secondary {grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,calc(28 * var(--phone-pixel)));gap:calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-toolbar-secondary>button {height:calc(28 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-assistance-toggle {position:absolute;right:calc(4 * var(--phone-pixel));bottom:calc(4 * var(--phone-pixel));display:flex;align-items:center;justify-content:center;gap:calc(6 * var(--phone-pixel));width:calc(100 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));border:calc(2 * var(--phone-pixel)) solid #abb1d1;border-radius:5px;background:linear-gradient(#8891de,#545cb3);color:#fffef0;font-size:calc(10 * var(--phone-pixel));touch-action:manipulation;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] :is(.reference-toolbar-label,.reference-auto-label) {font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-toolbar-heading {top:calc(154 * var(--phone-pixel));right:calc(4 * var(--phone-pixel));width:calc(100 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));line-height:1.15;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #tactical-status.reference-unit-menu {width:calc(132 * var(--phone-pixel));max-height:96%;padding:calc(5 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));border-width:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #tactical-status.reference-unit-menu>.reference-menu-name {font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #tactical-status.reference-unit-menu>.manual-actions {gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #tactical-status.reference-unit-menu .manual-actions>button {height:calc(30 * var(--phone-pixel));min-height:calc(30 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] #reference-battle-skills {width:calc(230 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-battle-skill-panel {width:100%;max-height:100%;padding:calc(5 * var(--phone-pixel));border-width:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-battle-skill-heading {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] #reference-battle-skill-panel .reference-battle-skill-heading>h3 {font-size:calc(16 * var(--phone-pixel))!important;line-height:1.2;}
#game-container[data-phone-layout="true"] [data-battle-rules="reference-v1"] .reference-battle-skill-close {flex:0 0 calc(32 * var(--phone-pixel));width:calc(32 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));font-size:calc(20 * var(--phone-pixel))!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .battle-modal>.battle-settings {--phone-pixel:1px;font-size:12px;}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .battle-modal>.battle-settings .battle-preferences-heading h3 {font-size:18px!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .battle-modal>.battle-settings .battle-setting-row {font-size:12px!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .battle-modal>.battle-settings .battle-setting-row>span>small {font-size:10px!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .battle-modal>.battle-settings .battle-preference-button {font-size:10px!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .battle-modal>.battle-settings .battle-preferences-close {width:32px;height:32px;}
#game-container[data-approved-ui][data-phone-layout="true"]:not([data-popup-text-measure]) .battle-modal>.battle-overlay-panel:not(.battle-settings)>h3 {font-size:calc(16 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .popup-pages-controls {min-height:calc(36 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .popup-pages-controls button {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));padding:0 calc(8 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop .village-workshop-button {height:calc(32 * var(--phone-pixel));min-height:calc(32 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .village-workshop-tabs {top:calc(26 * var(--phone-pixel));height:calc(28 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop-tabs .village-workshop-button {height:calc(28 * var(--phone-pixel));min-height:calc(28 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop-content {top:calc(64 * var(--phone-pixel));bottom:calc(144 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop-aside {bottom:calc(112 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop-jobs {height:calc(104 * var(--phone-pixel));gap:calc(2 * var(--phone-pixel));grid-template-rows:repeat(3,calc(32 * var(--phone-pixel)));}
#game-container[data-phone-layout="true"] .village-workshop-page {bottom:calc(108 * var(--phone-pixel));height:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop-page button {width:calc(32 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop:is([data-workshop-queue="0"],[data-workshop-queue="1"]) .village-workshop-jobs {height:calc(40 * var(--phone-pixel));grid-template-rows:minmax(0,1fr);}
#game-container[data-phone-layout="true"] .village-workshop:is([data-workshop-queue="0"],[data-workshop-queue="1"]) .village-workshop-content {bottom:calc(80 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop:is([data-workshop-queue="0"],[data-workshop-queue="1"]) .village-workshop-aside {bottom:calc(48 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .village-workshop:is([data-workshop-queue="0"],[data-workshop-queue="1"]) .village-workshop-page {bottom:calc(44 * var(--phone-pixel));}
@media (max-width:1200px) and (max-height:600px) {
  .pvp-roster-grid {grid-auto-columns:88px;}
  .pvp-roster-card {grid-template-rows:22px minmax(0,1fr) 12px;}
  .pvp-roster-card>strong {white-space:normal;text-overflow:clip;line-height:11px;overflow-wrap:anywhere;}
}

/* School and Scroll House retain their native cards; only the page track scrolls. */
#game-container[data-phone-layout="true"] :is(.rs-school-candidates,.sh-house-cards){display:flex;gap:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;touch-action:pan-x;overscroll-behavior-x:contain;}
#game-container[data-phone-layout="true"] :is(.rs-school-candidates,.sh-house-cards)::-webkit-scrollbar{display:none;}
#game-container[data-phone-layout="true"] :is(.rs-school-candidates,.sh-house-cards)[data-dragging="true"]{scroll-snap-type:none;user-select:none;cursor:grabbing;}
#game-container[data-phone-layout="true"] .popup-swipe-page{flex:0 0 100%;min-width:0;height:100%;scroll-snap-align:start;scroll-snap-stop:always;box-sizing:border-box;}
#game-container[data-phone-layout="true"] .rs-school-candidates>.popup-swipe-page{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4%;padding:calc(4 * var(--phone-pixel)) 0 calc(14 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-candidates .rs-school-card{height:100%;}
#game-container[data-phone-layout="true"] .rs-school-candidates .rs-school-reason{top:calc(100% + 2 * var(--phone-pixel));height:calc(12 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));line-height:calc(11 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .rs-school-page-dots>button[aria-current="page"]{background-image:url('/assets/bag/reference-v1/ui/page-dot-active.svg');}
#game-container[data-phone-layout="true"] .sh-house-view{overflow:visible!important;}
#game-container[data-phone-layout="true"] .sh-house-view .sh-house-title{top:calc(-10 * var(--phone-pixel));font-size:calc(18 * var(--phone-pixel))!important;line-height:1.1!important;}
#game-container[data-phone-layout="true"] .sh-house-info-frame{left:4%;top:8%;width:92%;height:24%;grid-template-columns:21% minmax(0,1fr);gap:calc(6 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-teacher{width:21%;height:190%;left:calc(4 * var(--phone-pixel));top:auto;bottom:-25%;}
#game-container[data-phone-layout="true"] .sh-house-teacher>img{width:100%;height:100%;object-fit:cover;object-position:center;}
#game-container[data-phone-layout="true"] .sh-house-information{font-size:calc(10 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-info-top{grid-template-columns:1fr 1fr auto;gap:calc(5 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-info-top>span,#game-container[data-phone-layout="true"] .sh-house-info-top b{font-size:calc(10 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-information :is(.sh-house-help,.sh-house-rates,.sh-house-upgrade-info,.sh-house-upgrade-info small){font-size:calc(9 * var(--phone-pixel));line-height:1.15;}
#game-container[data-phone-layout="true"] .sh-house-view .sh-house-action{height:calc(28 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel))!important;width:calc(100 * var(--phone-pixel));border-width:calc(5 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .sh-house-upgrade-panel{width:calc(340 * var(--phone-pixel));max-height:calc(220 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-separator{width:96%;left:2%;right:auto;}
#game-container[data-phone-layout="true"] .sh-house-separator-top{top:46%;}
#game-container[data-phone-layout="true"] .sh-house-separator-bottom{top:90%;}
#game-container[data-phone-layout="true"] .sh-house-clouds{top:auto;bottom:0;width:100%;height:26%;}
#game-container[data-phone-layout="true"] .sh-house-cards{left:4%;right:4%;top:51%;height:39%;}
#game-container[data-phone-layout="true"] .sh-house-cards>.popup-swipe-page{padding:calc(4 * var(--phone-pixel)) calc(30 * var(--phone-pixel)) calc(13 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-card{width:100%;height:100%;}
#game-container[data-phone-layout="true"] .sh-house-view .sh-house-card-title{height:calc(22 * var(--phone-pixel));font-size:calc(11 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .sh-house-card-body{height:calc(100% - 48 * var(--phone-pixel));grid-template-columns:25% minmax(0,1fr);gap:calc(5 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-card-information{gap:calc(2 * var(--phone-pixel));font-size:calc(10 * var(--phone-pixel));padding:calc(3 * var(--phone-pixel));overflow:auto;}
#game-container[data-phone-layout="true"] .sh-house-card-information :is(p,time,b){font-size:inherit!important;line-height:1.15!important;}
#game-container[data-phone-layout="true"] .sh-house-card-information .sh-house-book-effect{display:block;-webkit-line-clamp:unset;font-size:calc(9 * var(--phone-pixel))!important;}
#game-container[data-phone-layout="true"] .sh-house-book-pane{padding:calc(3 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-view .sh-house-card-footer{bottom:0;height:calc(28 * var(--phone-pixel));gap:calc(5 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-card-reason{top:auto;bottom:calc(-12 * var(--phone-pixel));height:calc(11 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));line-height:1.1;}
#game-container[data-phone-layout="true"] .sh-house-page{left:4%;right:auto;bottom:0;width:60%;font-size:calc(9 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));display:flex;align-items:center;}
#game-container[data-phone-layout="true"] .sh-house-page-arrow{position:absolute;top:50%;width:calc(32 * var(--phone-pixel));height:calc(40 * var(--phone-pixel));background:url('/assets/bag/reference-v1/ui/page-next.svg') center/contain no-repeat;}
#game-container[data-phone-layout="true"] .sh-house-page-prev{left:calc(-25 * var(--phone-pixel));background-image:url('/assets/bag/reference-v1/ui/page-prev.svg');}
#game-container[data-phone-layout="true"] .sh-house-page-next{right:calc(-25 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-page-dots{position:absolute;right:4%;bottom:0;height:calc(24 * var(--phone-pixel));display:flex;align-items:center;gap:calc(4 * var(--phone-pixel));font-size:calc(9 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .sh-house-page-dots>button{width:calc(24 * var(--phone-pixel));height:calc(24 * var(--phone-pixel));background:url('/assets/bag/reference-v1/ui/page-dot.svg') center/30% 30% no-repeat;}
#game-container[data-phone-layout="true"] .sh-house-page-dots>button[aria-current="page"]{background-image:url('/assets/bag/reference-v1/ui/page-dot-active.svg');}
/* The original book fills the phone height. Five rows use its native small-row composition. */
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-match-tip{left:34%!important;top:.5%!important;width:58%!important;height:5.5%!important;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:calc(6 * var(--phone-pixel));white-space:nowrap;font-size:calc(9 * var(--phone-pixel));padding:0 calc(4 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-tip-cycle{height:70%;font-size:calc(9 * var(--phone-pixel));flex-shrink:0;gap:calc(2 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-tip-cycle svg{width:calc(14 * var(--phone-pixel));height:calc(14 * var(--phone-pixel));}
#game-container[data-phone-layout="true"] .ninja-owned-v2 .nov2-skill-tile+.nov2-control{height:calc(24 * var(--phone-pixel))!important;}
/* Independent Equipment lists keep their own footer navigation. Each arrow
   uses the same artwork and physical target without crossing the other list. */
#game-container[data-approved-ui][data-phone-layout="true"] .equipment-ui :is(.equipment-roster-pager,.equipment-grid-pager){display:grid!important;flex:0 0 calc(40 * var(--phone-equipment-pixel))!important;height:calc(40 * var(--phone-equipment-pixel))!important;min-height:calc(40 * var(--phone-equipment-pixel))!important;grid-template-columns:calc(32 * var(--phone-equipment-pixel)) minmax(0,1fr) calc(32 * var(--phone-equipment-pixel));align-items:center;gap:0;}
#game-container[data-approved-ui][data-phone-layout="true"] .equipment-ui :is(.equipment-roster-pager,.equipment-grid-pager)>button{width:calc(32 * var(--phone-equipment-pixel))!important;height:calc(40 * var(--phone-equipment-pixel))!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent url('/assets/bag/reference-v1/ui/page-prev.svg') center/contain no-repeat!important;color:transparent!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .equipment-ui :is(.equipment-roster-pager,.equipment-grid-pager)>button:last-child{background-image:url('/assets/bag/reference-v1/ui/page-next.svg')!important;}
#game-container[data-approved-ui][data-phone-layout="true"] .equipment-ui :is(.equipment-roster-pager,.equipment-grid-pager)>span{font-size:calc(9 * var(--phone-equipment-pixel))!important;white-space:nowrap;}

/* Settings scroll within their paper on short viewports; card contents keep
   their natural height instead of squeezing controls into fixed rows. */
#game-container[data-phone-layout="true"] .sh-house-instant-cost{font-size:calc(9 * var(--phone-pixel));min-height:calc(18 * var(--phone-pixel));gap:calc(3 * var(--phone-pixel))}
#game-container[data-phone-layout="true"] .sh-house-instant-art{width:calc(18 * var(--phone-pixel));height:calc(18 * var(--phone-pixel));flex-basis:calc(18 * var(--phone-pixel))}

#game-container[data-phone-layout="true"] .sa-setup{--setup-roster-height:92px;--setup-roster-bottom:8px;--setup-action-width:clamp(104px,14cqw,120px);--setup-dock-gap:8px}
#game-container[data-phone-layout="true"] .sa-setup>:is(.sa-battle-board,.sa-setup-brief,.sa-setup-intel){bottom:calc(var(--setup-roster-height) + 40px)}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-hint{bottom:calc(var(--setup-roster-height) + 24px);left:3cqw;right:3cqw;height:16px;gap:6px}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-hint>span{display:none}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-roster-heading{bottom:calc(var(--setup-roster-height) + 8px);height:16px;font-size:11px}
#game-container[data-phone-layout="true"] .sa-setup-roster-heading small{font-size:10px}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-navigation{display:none}
#game-container[data-phone-layout="true"] .sa-setup-roster-heading::after{content:"Geser ninja ↔";flex-shrink:0;font-size:10px;font-weight:normal;letter-spacing:0;color:#c5d9cf}
#game-container[data-phone-layout="true"] .sa-setup>.sa-roster-strip{top:auto;bottom:8px;height:var(--setup-roster-height);padding:2px 4px;gap:4px}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-card{flex-basis:66px;grid-template-rows:13px minmax(0,1fr);gap:1px;padding:0}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-card>strong{font-size:10px;line-height:13px;-webkit-text-stroke:1.5px #fffdf0}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-card-body{grid-template-rows:minmax(0,1fr) 13px;gap:0;padding:2px 3px 0;border-width:1.5px;border-radius:7px}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-level{gap:6px;font-size:12px;line-height:13px}
#game-container[data-phone-layout="true"] .sa-setup .sa-roster-level>svg{width:13px;height:13px}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-actions{top:auto;bottom:var(--setup-roster-bottom);height:var(--setup-roster-height);display:grid;grid-template-rows:repeat(2,minmax(44px,1fr));gap:4px}
#game-container[data-phone-layout="true"] .sa-setup .sa-setup-actions>.sa-action{position:static;box-sizing:border-box;width:100%;height:auto;min-width:0;min-height:44px;padding:3px 5px;border-width:1.5px;border-radius:6px;font-size:12px;line-height:1.15}
#game-container[data-phone-layout="true"] .sa-setup-actions>:is([data-story-action="setup-finish"],[data-kage-action="invade-setup-finish"]){gap:3px}
#game-container[data-phone-layout="true"] .sa-setup-actions>:is([data-story-action="setup-finish"],[data-kage-action="invade-setup-finish"])>strong{white-space:nowrap}
#game-container[data-phone-layout="true"] .sa-setup-actions>:is([data-story-action="setup-finish"],[data-kage-action="invade-setup-finish"])>small{gap:4px;font-size:11px;line-height:14px;white-space:nowrap}
#game-container[data-phone-layout="true"] .sa-setup-actions>:is([data-story-action="setup-finish"],[data-kage-action="invade-setup-finish"])>small>svg{flex:none;width:13px;height:14px}

@container game (max-height:360px){
  #game-container[data-phone-layout="true"] .sa-setup{--setup-roster-height:76px;--setup-action-width:clamp(164px,27cqw,184px)}
  #game-container[data-phone-layout="true"] .sa-setup .sa-roster-card{flex-basis:62px}
  #game-container[data-phone-layout="true"] .sa-setup>.sa-setup-actions{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);grid-template-rows:minmax(44px,1fr);gap:6px}
}

#game-container[data-phone-layout="true"] .sa-setup>:is(.sa-roster-strip,.sa-setup-roster-heading){right:calc(3cqw + var(--setup-action-width) + var(--setup-dock-gap))}
#game-container[data-phone-layout="true"] .sa-setup>.sa-setup-actions{width:var(--setup-action-width)}
