/* Independent M1 flat playtest. Original V1 and painted presentation stay intact. */
body[data-m1-flat] #m1-playtest-label {
  position:absolute; z-index:1; right:8px; bottom:calc(100% + 4px);
  display:block; margin:0; padding:2px 7px; border-radius:4px;
  color:#f8efd3; background:#30434deb; box-shadow:inset 0 0 0 1px #b59d665c;
  font-size:11px; line-height:16px; font-weight:600; white-space:nowrap;
  pointer-events:none;
}
body[data-m1-flat] .tower-afford:not([hidden]) {
  display:block; margin:0; color:#943d2b; font-size:10px; line-height:12px;
  font-weight:700; white-space:nowrap;
}
body[data-m1-flat] .tower-button.unaffordable { opacity:1; }
body[data-m1-flat] .game-shell[data-layout-device="portrait"] .tower-button.unaffordable .tower-icon {
  width:16px; height:16px;
}
/* Keep price and shortfall legible inside the existing shop row. During a
 * preview its lower18px remain available for the selected tower's status. */
body[data-m1-flat] .game-shell[data-layout-device="portrait"][data-preview="true"] #tower-shop {
  height:44px; grid-template-rows:44px;
}
body[data-m1-flat] .game-shell[data-layout-device="portrait"][data-preview="true"] .tower-button {
  height:44px; min-height:44px; padding:0; gap:0;
}
body[data-m1-flat] .game-shell[data-layout-device="portrait"]:is([data-awaiting-ground="true"],[data-preview="true"]) .tower-icon {
  width:16px; height:16px;
}
body[data-m1-flat] .game-shell[data-layout-device="portrait"]:is([data-awaiting-ground="true"],[data-preview="true"]) .unaffordable .tower-icon,
body[data-m1-flat] .game-shell[data-side-controls="true"] .unaffordable .tower-icon { display:none; }
body[data-m1-flat] .game-shell[data-layout-device="portrait"][data-preview="true"] :is(.tower-copy strong,.tower-price) {
  font-size:11px; line-height:12px;
}
body[data-m1-flat] .game-shell[data-preview="true"] .placement-hint:not([hidden]) { display:flex; }
body[data-m1-flat] #placement-title { display:none; }
body[data-m1-flat] .game-shell[data-layout-device="portrait"] #placement-status {
  display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis;
  font-size:11px; line-height:18px; white-space:nowrap;
}
body[data-m1-flat] .game-shell[data-layout-device="portrait"] #placement-status.invalid {
  color:#ffe0b8!important;
}
/* A short explanation stays inside the192px rail instead of becoming a
 * floating instruction over the route. It uses existing flexible shop room. */
body[data-m1-flat] .game-shell[data-side-controls="true"] #placement-panel {
  position:relative; inset:auto; order:2; flex:none; width:100%; max-width:100%;
  height:28px; min-height:28px; margin:2px 0 0; padding:0 3px;
  overflow:visible; clip-path:none; border:0; border-radius:0; box-shadow:none;
  color:#f8efd3; background:none; font-size:11px; line-height:14px;
}
body[data-m1-flat] .game-shell[data-side-controls="true"] #placement-status {
  color:#f8efd3; font-size:11px; line-height:14px;
}
body[data-m1-flat] .game-shell[data-side-controls="true"] #placement-status.invalid { color:#ffe0b8!important; }
body[data-m1-flat] .game-shell[data-side-controls="true"] #tower-shop { flex:1; }
body[data-m1-flat] .game-shell[data-side-controls="true"] #m1-playtest-label {
  position:fixed; top:calc(var(--safe-top) + 5px); bottom:auto;
  right:calc(192px + var(--safe-right) + 8px);
}
